mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Fixing fatal errors when running postgres
This commit is contained in:
parent
df303f9e09
commit
783b5d4d1c
2 changed files with 8 additions and 4 deletions
|
@ -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];
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue