mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Returning default column type for models with no schema defined
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6482 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
3a11fe2340
commit
97dded350f
2 changed files with 2 additions and 8 deletions
|
@ -886,13 +886,10 @@ class Model extends Overloadable {
|
|||
*/
|
||||
function getColumnType($column) {
|
||||
$cols = $this->schema();
|
||||
if (empty($cols)) {
|
||||
trigger_error(__('(Model::getColumnType) Unable to locate model field data. If you are using a model without a database table, try implementing schema()', true), E_USER_WARNING);
|
||||
}
|
||||
if (isset($cols[$column]['type'])) {
|
||||
if (isset($cols[$column]) && isset($cols[$column]['type'])) {
|
||||
return $cols[$column]['type'];
|
||||
}
|
||||
return null;
|
||||
return 'string';
|
||||
}
|
||||
/**
|
||||
* Returns true if this Model has given field in its database table.
|
||||
|
|
|
@ -119,9 +119,6 @@ class FormHelper extends AppHelper {
|
|||
|
||||
if (isset($object)) {
|
||||
$fields = $object->schema();
|
||||
if (empty($fields)) {
|
||||
trigger_error(__('(FormHelper::create) Unable to use model field data. If you are using a model without a database table, try implementing schema()', true), E_USER_WARNING);
|
||||
}
|
||||
if (!empty($object->hasAndBelongsToMany)) {
|
||||
foreach ($object->hasAndBelongsToMany as $alias => $assocData) {
|
||||
$fields[$alias] = array('type' => 'multiple');
|
||||
|
|
Loading…
Add table
Reference in a new issue