*/ class Mage_Api2_Model_Resource_Acl_Global_Role_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract { /** * Initialize collection model * * @return void */ protected function _construct() { $this->_init('api2/acl_global_role'); } /** * Add filter by admin user id and join table with appropriate information * * @param int $id Admin user id * @return Mage_Api2_Model_Resource_Acl_Global_Role_Collection */ public function addFilterByAdminId($id) { $this->getSelect() ->joinInner( array('user' => $this->getTable('api2/acl_user')), 'main_table.entity_id = user.role_id', array('admin_id' => 'user.admin_id')) ->where('user.admin_id = ?', $id, Zend_Db::INT_TYPE); return $this; } }