mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
update ModelTask and FormHelper for tinyint,smallint
This commit is contained in:
parent
7c0bcb16c8
commit
c0ea3d08e6
2 changed files with 16 additions and 5 deletions
|
@ -450,6 +450,10 @@ class ModelTask extends BakeTask {
|
|||
$guess = $methods['notBlank'];
|
||||
} elseif ($metaData['type'] === 'integer') {
|
||||
$guess = $methods['numeric'];
|
||||
} elseif ($metaData['type'] === 'smallint') {
|
||||
$guess = $methods['numeric'];
|
||||
} elseif ($metaData['type'] === 'tinyint') {
|
||||
$guess = $methods['numeric'];
|
||||
} elseif ($metaData['type'] === 'float') {
|
||||
$guess = $methods['numeric'];
|
||||
} elseif ($metaData['type'] === 'boolean') {
|
||||
|
|
|
@ -1236,11 +1236,18 @@ class FormHelper extends AppHelper {
|
|||
$type = $fieldDef['type'];
|
||||
$primaryKey = $this->fieldset[$modelKey]['key'];
|
||||
$map = array(
|
||||
'string' => 'text', 'datetime' => 'datetime',
|
||||
'boolean' => 'checkbox', 'timestamp' => 'datetime',
|
||||
'text' => 'textarea', 'time' => 'time',
|
||||
'date' => 'date', 'float' => 'number',
|
||||
'integer' => 'number', 'decimal' => 'number',
|
||||
'string' => 'text',
|
||||
'datetime' => 'datetime',
|
||||
'boolean' => 'checkbox',
|
||||
'timestamp' => 'datetime',
|
||||
'text' => 'textarea',
|
||||
'time' => 'time',
|
||||
'date' => 'date',
|
||||
'float' => 'number',
|
||||
'integer' => 'number',
|
||||
'smallint' => 'number',
|
||||
'tinyint' => 'number',
|
||||
'decimal' => 'number',
|
||||
'binary' => 'file'
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in a new issue