Example #1
0
 /**
  * Save a DAO to the data store
  *
  * @param IDao $dao
  *
  * @return array of changed properties
  *
  * @throws DataStoreException
  */
 public function save(IDao $dao)
 {
     $dao = $this->_verifyDao($dao);
     parent::save($dao);
 }
Example #2
0
 /**
  * Get the data store for this dao
  *
  * @return QlDataStore
  *
  * @throws DataStoreNotFoundException
  */
 public function getDataStore()
 {
     $resolver = static::getDalResolver();
     try {
         return $resolver->getDataStore($this->_dataStoreName);
     } catch (DataStoreNotFoundException $e) {
         if ($resolver->hasConnection($this->_dataStoreName)) {
             $config = new ConfigSection($this->_dataStoreName, ['connection' => $this->_dataStoreName]);
             $dataStore = new QlDataStore();
             $dataStore->configure($config);
             $resolver->addDataStoreConfig($config);
             $resolver->addDataStore($this->_dataStoreName, $dataStore);
             return $dataStore;
         }
         throw $e;
     }
 }
Example #3
0
 public function testUnconfiguredGetConnection()
 {
     $datastore = new QlDataStore();
     $this->setExpectedException('\\Packaged\\Dal\\Exceptions\\DalResolver\\ConnectionNotFoundException');
     $datastore->getConnection();
 }