/** * 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); }
/** * @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()); }
public function __construct(AdapterInterface $adapter) { parent::__construct($adapter); $this->decorators['mysql'] = (new Mysql\Mysql())->getDecorators(); $this->decorators['postgresql'] = (new PostgreSQL\PostgreSQL())->getDecorators(); }