_init('aw_hdu3/department_agent'); } /** * @param int $userID * * @return $this */ public function loadAgentByUserId($userID) { return $this->load($userID, 'user_id'); } /** * @return AW_Helpdesk3_Model_Resource_Department_Collection */ public function getDepartmentCollection() { $departmentCollection = Mage::getModel('aw_hdu3/department')->getCollection()->addActiveFilter()->addNotDeletedFilter(); $departmentCollection->addFilterByAgentId($this->getId()); return $departmentCollection; } /** * @return AW_Helpdesk3_Model_Resource_Department_Collection */ public function getFullDepartmentCollection() { $departmentCollection = Mage::getModel('aw_hdu3/department')->getCollection()->addNotDeletedFilter(); $departmentCollection->addFilterByAgentId($this->getId()); return $departmentCollection; } /** * @return AW_Helpdesk3_Model_Resource_Department_Collection */ public function getTicketCollection() { /** @var AW_Helpdesk3_Model_Resource_Ticket_Collection $ticketCollection */ $ticketCollection = Mage::getModel('aw_hdu3/ticket')->getCollection(); $ticketCollection->addFilterByAgentId($this->getId()); return $ticketCollection; } }