/** * @param SqlInterface|null $sql * @return StatementInterface */ public function prepareStatement(SqlInterface $sql = null) { $sql = $sql ?: $this->lastSql; if (!$sql) { throw new Exception\InvalidArgumentException('Sql sequence is not supplied.'); } return $sql->prepareStatement($this->adapter->getPlatform(), $this->adapter->getDriver()); }
/** * 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; }