Exemple #1
0
 /**
  * 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);
 }
Exemple #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());
 }