/**
  * Initializes the application component.
  * This method overrides the parent implementation by establishing the database connection.
  */
 public function init()
 {
     parent::init();
     $this->db = Instance::ensure($this->db, Connection::className());
     $this->db->getCollection($this->itemTable)->createIndex(['name' => 1], ['unique' => true]);
     $this->db->getCollection($this->ruleTable)->createIndex(['name' => 1], ['unique' => true]);
 }
 /**
  * Initializes the application component.
  * This method overrides the parent implementation by establishing the database connection.
  */
 public function init()
 {
     parent::init();
     $this->db = Instance::ensure($this->db, Connection::className());
 }
Esempio n. 3
0
 /**
  * Initializes the application component.
  * This method overrides parent implementation by loading the authorization data
  * from PHP script.
  */
 public function init()
 {
     parent::init();
     $this->itemFile = Yii::getAlias($this->itemFile);
     $this->assignmentFile = Yii::getAlias($this->assignmentFile);
     $this->ruleFile = Yii::getAlias($this->ruleFile);
     $this->load();
 }
Esempio n. 4
0
 /**
  * Initializes the application component.
  * This method overrides the parent implementation by establishing the database connection.
  */
 public function init()
 {
     parent::init();
     $this->db = Instance::ensure($this->db, Connection::className());
     if ($this->cache !== null) {
         $this->cache = Instance::ensure($this->cache, Cache::className());
     }
 }
Esempio n. 5
0
 /**
  * Initializes the application component.
  * This method overrides parent implementation by loading the authorization data
  * from PHP script.
  */
 public function init()
 {
     parent::init();
     $this->db = Instance::ensure($this->db, Connection::className());
     if ($this->enableCaching) {
         $this->cache = Instance::ensure($this->cache, Cache::className());
     } else {
         $this->cache = null;
     }
 }
Esempio n. 6
0
 /**
  * Initializes the application component.
  * This method overrides parent implementation by loading the authorization data
  * from PHP script.
  */
 public function init()
 {
     parent::init();
     $this->authFile = Yii::getAlias($this->authFile);
     $this->load();
 }