Exemplo n.º 1
0
 /**
  * @param \DibiConnection $dibiConnection
  * @param \obo\Interfaces\ICache $cache
  */
 public function __construct(\DibiConnection $dibiConnection, \obo\DataStorage\Interfaces\IDataConverter $dataConverter, \obo\Interfaces\ICache $cache = null)
 {
     if ($dibiConnection->getConfig("driver") !== "mysqli" and $dibiConnection->getConfig("driver") !== "mysql") {
         throw new \obo\Exceptions\Exception("Wrong driver has been set for dibi connection. Mysql or mysqli driver was expected.");
     }
     $this->dibiConnection = $dibiConnection;
     $this->dibiTranslator = new \DibiTranslator($this->dibiConnection);
     $this->dataConverter = $dataConverter;
     $this->cache = $cache;
 }
Exemplo n.º 2
0
 /**
  * Returns a blank row (not fetched from database).
  * @return array|object
  */
 public function createBlank()
 {
     $row = $this->blankRow;
     $row[$this->primary] = NULL;
     if ($class = $this->connection->getConfig('result:objects')) {
         if ($class === TRUE) {
             $row = (object) $row;
         } else {
             $row = new $class($row);
         }
     }
     return $row;
 }