示例#1
0
 /**
  * get instance
  *
  *
  * @return Auth_Model_ResourceMapper
  */
 public static function getInstance()
 {
     if (self::$_instance === null) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
示例#2
0
 protected function _loadResources()
 {
     $resources = Auth_Model_ResourceMapper::getInstance()->fetchAll(array(), array('r.parent_id ASC'));
     /* @var $resource Auth_Model_Resource */
     foreach ($resources as $resource) {
         if ($resource->get_parent_id() > 0) {
             $this->_acl->addResource($resource->get_code(), $resources[$role->get_parent_id()]);
         } else {
             $this->_acl->addResource($resource->get_code());
         }
     }
 }