Example #1
0
 /**
  * @param SqlInterface|null $sql
  * @return string
  */
 public function getSqlString(SqlInterface $sql = null)
 {
     $sql = $sql ?: $this->lastSql;
     if (!$sql) {
         throw new Exception\InvalidArgumentException('Sql sequence is not supplied.');
     }
     return $sql->getSqlString($this->adapter->getPlatform());
 }
Example #2
0
 /**
  * Constructor
  *
  * @param AdapterInterface $adapter
  */
 public function __construct(AdapterInterface $adapter)
 {
     $this->adapter = $adapter;
     $this->cacher = CachePool::get('MetadataCacher');
     $this->defaultSchema = $adapter->getDriver()->getConnection()->getCurrentSchema() ?: self::DEFAULT_SCHEMA;
 }