Public Member Functions | |
getRoleUsers (Mage_Admin_Model_Roles $role) | |
Protected Member Functions | |
_construct () | |
_beforeSave (Mage_Core_Model_Abstract $role) | |
_afterSave (Mage_Core_Model_Abstract $role) | |
_afterDelete (Mage_Core_Model_Abstract $role) | |
Protected Attributes | |
$_usersTable | |
$_ruleTable |
Definition at line 27 of file Roles.php.
_afterDelete | ( | Mage_Core_Model_Abstract $ | object | ) | [protected] |
Perform actions after object delete
Varien_Object | $object |
Reimplemented from Mage_Core_Model_Mysql4_Abstract.
Definition at line 67 of file Roles.php.
00068 { 00069 $this->_getWriteAdapter()->delete($this->getMainTable(), "parent_id={$role->getId()}"); 00070 $this->_getWriteAdapter()->delete($this->_ruleTable, "role_id={$role->getId()}"); 00071 return $this; 00072 }
_afterSave | ( | Mage_Core_Model_Abstract $ | object | ) | [protected] |
Perform actions after object save
Varien_Object | $object |
Reimplemented from Mage_Core_Model_Mysql4_Abstract.
Definition at line 59 of file Roles.php.
00060 { 00061 $this->_updateRoleUsersAcl($role); 00062 Mage::app()->getCache()->clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG, 00063 array(Mage_Adminhtml_Block_Page_Menu::CACHE_TAGS)); 00064 return $this; 00065 }
_beforeSave | ( | Mage_Core_Model_Abstract $ | object | ) | [protected] |
Perform actions before object save
Varien_Object | $object |
Reimplemented from Mage_Core_Model_Mysql4_Abstract.
Definition at line 39 of file Roles.php.
00040 { 00041 if ($role->getId() == '') { 00042 if ($role->getIdFieldName()) { 00043 $role->unsetData($role->getIdFieldName()); 00044 } else { 00045 $role->unsetData('id'); 00046 } 00047 } 00048 00049 if ($role->getPid() > 0) { 00050 $row = $this->load($role->getPid()); 00051 } else { 00052 $row = array('tree_level' => 0); 00053 } 00054 $role->setTreeLevel($row['tree_level'] + 1); 00055 $role->setRoleName($role->getName()); 00056 return $this; 00057 }
_construct | ( | ) | [protected] |
Resource initialization
Reimplemented from Mage_Core_Model_Resource_Abstract.
Definition at line 32 of file Roles.php.
00032 { 00033 $this->_init('admin/role', 'role_id'); 00034 00035 $this->_usersTable = $this->getTable('admin/user'); 00036 $this->_ruleTable = $this->getTable('admin/rule'); 00037 }
getRoleUsers | ( | Mage_Admin_Model_Roles $ | role | ) |
Definition at line 74 of file Roles.php.
00075 { 00076 $read = $this->_getReadAdapter(); 00077 $select = $read->select()->from($this->getMainTable(), array('user_id'))->where("(parent_id = '{$role->getId()}' AND role_type = 'U') AND user_id > 0"); 00078 return $read->fetchCol($select); 00079 }