我在JTable绑定方法覆盖中有以下代码:
if(!JFactory::getUser()->authorise('core.admin', 'com_escorders.audittrail.'.$array['id'])){
$actions = JFactory::getACL()->getActions('com_escorders','audittrail');
$default_actions = JFactory::getACL()->getAssetRules('com_escorders.audittrail.'.$array['id'])->getData();
$array_jaccess = array();
foreach($actions as $action){
$array_jaccess[$action->name] = $default_actions[$action->name];
}
$array['rules'] = $this->JAccessRulestoArray($array_jaccess);
}
当主键为id
时,这可以正常工作,但我想为具有多个键的表修改此代码。假设密钥为array['id']
和key1
,我需要取代key2
?