public function getByName($name) { try { $dao = new Busunit_Persist_Dao_Busunit(); return $dao->getByName($name, array(Zend_Auth::getInstance()->getIdentity()->appaccount_id)); } catch (Exception $e) { throw $e; } }
/** * * @param integer $appaccount_id * @return Busunit_Model_Headquarters * @throws Exception * @throws Agana_Exception */ public function getByAppAccount($appaccount_id) { try { if (Agana_Acl_Service::isAllowed(Zend_Auth::getInstance()->getIdentity()->acl_role_id, Busunit_Module_Acl::ACL_RESOURCE_BUSUNIT_HEAD, Busunit_Module_Acl::ACL_RESOURCE_BUSUNIT_HEAD_PRIVILEGE_VIEW)) { $dao = new Busunit_Persist_Dao_Busunit(); return $dao->getByAppAccount($appaccount_id, 1); } else { throw new Agana_Exception('You don not have permission to access this'); } } catch (Exception $e) { throw $e; } }