Public Member Functions | |
getRoleUsers (Mage_Api_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 66 of file Roles.php.
00067 { 00068 $this->_getWriteAdapter()->delete($this->getMainTable(), "parent_id={$role->getId()}"); 00069 $this->_getWriteAdapter()->delete($this->_ruleTable, "role_id={$role->getId()}"); 00070 return $this; 00071 }
_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 return $this; 00064 }
_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] |
getRoleUsers | ( | Mage_Api_Model_Roles $ | role | ) |
Definition at line 73 of file Roles.php.
00074 { 00075 $read = $this->_getReadAdapter(); 00076 $select = $read->select()->from($this->getMainTable(), array('user_id'))->where("(parent_id = '{$role->getId()}' AND role_type = 'U') AND user_id > 0"); 00077 return $read->fetchCol($select); 00078 }