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'];
|
$guess = $methods['notBlank'];
|
||||||
} elseif ($metaData['type'] === 'integer') {
|
} elseif ($metaData['type'] === 'integer') {
|
||||||
$guess = $methods['numeric'];
|
$guess = $methods['numeric'];
|
||||||
|
} elseif ($metaData['type'] === 'smallint') {
|
||||||
|
$guess = $methods['numeric'];
|
||||||
|
} elseif ($metaData['type'] === 'tinyint') {
|
||||||
|
$guess = $methods['numeric'];
|
||||||
} elseif ($metaData['type'] === 'float') {
|
} elseif ($metaData['type'] === 'float') {
|
||||||
$guess = $methods['numeric'];
|
$guess = $methods['numeric'];
|
||||||
} elseif ($metaData['type'] === 'boolean') {
|
} elseif ($metaData['type'] === 'boolean') {
|
||||||
|
|
|
@ -1236,11 +1236,18 @@ class FormHelper extends AppHelper {
|
||||||
$type = $fieldDef['type'];
|
$type = $fieldDef['type'];
|
||||||
$primaryKey = $this->fieldset[$modelKey]['key'];
|
$primaryKey = $this->fieldset[$modelKey]['key'];
|
||||||
$map = array(
|
$map = array(
|
||||||
'string' => 'text', 'datetime' => 'datetime',
|
'string' => 'text',
|
||||||
'boolean' => 'checkbox', 'timestamp' => 'datetime',
|
'datetime' => 'datetime',
|
||||||
'text' => 'textarea', 'time' => 'time',
|
'boolean' => 'checkbox',
|
||||||
'date' => 'date', 'float' => 'number',
|
'timestamp' => 'datetime',
|
||||||
'integer' => 'number', 'decimal' => 'number',
|
'text' => 'textarea',
|
||||||
|
'time' => 'time',
|
||||||
|
'date' => 'date',
|
||||||
|
'float' => 'number',
|
||||||
|
'integer' => 'number',
|
||||||
|
'smallint' => 'number',
|
||||||
|
'tinyint' => 'number',
|
||||||
|
'decimal' => 'number',
|
||||||
'binary' => 'file'
|
'binary' => 'file'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue