*/ class Mage_Admin_Model_Resource_Role_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract { /** * Initialize resource model * */ protected function _construct() { $this->_init('admin/role'); } /** * Add user filter * * @param int $userId * @return Mage_Admin_Model_Resource_Role_Collection */ public function setUserFilter($userId) { $this->addFieldToFilter('user_id', $userId); $this->addFieldToFilter('role_type', 'G'); return $this; } /** * Set roles filter * * @return Mage_Admin_Model_Resource_Role_Collection */ public function setRolesFilter() { $this->addFieldToFilter('role_type', 'G'); return $this; } }