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']; $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') {

View file

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