diff --git a/lib/Cake/Model/Datasource/DataSource.php b/lib/Cake/Model/Datasource/DataSource.php index 074ec5d3a..34d7a4929 100644 --- a/lib/Cake/Model/Datasource/DataSource.php +++ b/lib/Cake/Model/Datasource/DataSource.php @@ -114,14 +114,18 @@ class DataSource extends Object { /** * Returns a Model description (metadata) or null if none found. * - * @param Model $model + * @param Model|string $model * @return array Array of Metadata for the $model */ - public function describe(Model $model) { + public function describe($model) { if ($this->cacheSources === false) { return null; } - $table = $model->tablePrefix . $model->table; + if (is_string($model)) { + $table = $model; + } else { + $table = $model->tablePrefix . $model->table; + } if (isset($this->_descriptions[$table])) { return $this->_descriptions[$table]; diff --git a/lib/Cake/Model/Datasource/Database/Postgres.php b/lib/Cake/Model/Datasource/Database/Postgres.php index e25b5b675..513741446 100644 --- a/lib/Cake/Model/Datasource/Database/Postgres.php +++ b/lib/Cake/Model/Datasource/Database/Postgres.php @@ -186,7 +186,7 @@ class Postgres extends DboSource { * @param Model $model Name of database table to inspect * @return array Fields in table. Keys are name and type */ - public function describe(Model $model) { + public function describe($model) { $fields = parent::describe($model); $table = $this->fullTableName($model, false); $this->_sequenceMap[$table] = array();