/** * Gets the SqlDbCore Schema object. * * @return Schema * @throws \Exception */ public function getSchema() { if (empty($this->schema)) { $connection = $this->getConnection(); $adaptedConnection = ConnectionAdapter::getLegacyConnection($connection); $this->schema = $adaptedConnection->getSchema(); } return $this->schema; }
/** * Gets the TableSchema for this model. * * @return TableSchema */ public function getTableSchema() { if (empty($this->adaptedConnection)) { $connection = $this->getConnection(); $this->adaptedConnection = ConnectionAdapter::getLegacyConnection($connection); $this->cachePrefix = 'model_' . $this->getTable() . ':'; $this->adaptedConnection->setCache($this); } return $this->adaptedConnection->getSchema()->getTable($this->table); }