Example #1
0
 /**
  * @return mongoInstance
  * @throws storageException
  */
 public function storage()
 {
     if ($this->storageInstance === null) {
         $config = config::getConfig(get_called_class());
         $this->mongoCrudStorageConfig = $config['storage'];
         if (!array_key_exists('configSection', $this->mongoCrudStorageConfig)) {
             throw new storageException('Unable to find config[storage][configSection] in case of mongoCrud usage');
         }
         $this->storageInstance = mongoInstance::factory($this->mongoCrudStorageConfig['configSection']);
     }
     return $this->storageInstance;
 }
 /**
  * @return mongoInstance
  */
 protected function storage()
 {
     if ($this->mongoInstance === null) {
         $this->mongoInstance = mongoInstance::factory($this->config['configSection']);
     }
     return $this->mongoInstance;
 }