update ModelTask and FormHelper for tinyint,smallint

This commit is contained in:
Sebastien Barre 2017-03-05 22:17:28 -05:00
parent 7c0bcb16c8
commit c0ea3d08e6
2 changed files with 16 additions and 5 deletions

View file

@ -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') {

View file

@ -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'
);