Exemplo n.º 1
0
Arquivo: Sql.php Projeto: tillk/vufind
 /**
  * Get sql string using platform or sql object
  *
  * @param SqlInterface      $sqlObject
  * @param PlatformInterface $platform
  *
  * @return string
  */
 public function getSqlStringForSqlObject(SqlInterface $sqlObject, PlatformInterface $platform = null)
 {
     $platform = $platform ?: $this->adapter->getPlatform();
     if ($this->sqlPlatform) {
         $this->sqlPlatform->setSubject($sqlObject);
         return $this->sqlPlatform->getSqlString($platform);
     }
     return $sqlObject->getSqlString($platform);
 }
Exemplo n.º 2
0
 /**
  * @param SqlInterface     $sqlObject
  * @param AdapterInterface $adapter
  *
  * @return string
  *
  * @throws Exception\InvalidArgumentException
  */
 public function buildSqlString(SqlInterface $sqlObject, AdapterInterface $adapter = null)
 {
     return $this->sqlPlatform->setSubject($sqlObject)->getSqlString($adapter ? $adapter->getPlatform() : $this->adapter->getPlatform());
 }
Exemplo n.º 3
0
 public function __construct(AdapterInterface $adapter)
 {
     parent::__construct($adapter);
     $this->decorators['mysql'] = (new Mysql\Mysql())->getDecorators();
     $this->decorators['postgresql'] = (new PostgreSQL\PostgreSQL())->getDecorators();
 }