Skip to content
Permalink
Browse files

update ModelTask and FormHelper for tinyint,smallint

  • Loading branch information...
sebastienbarre committed Mar 6, 2017
1 parent 7c0bcb1 commit c0ea3d08e6aff91ef8de0785b2168015e840797e
Showing with 16 additions and 5 deletions.
  1. +4 −0 lib/Cake/Console/Command/Task/ModelTask.php
  2. +12 −5 lib/Cake/View/Helper/FormHelper.php
@@ -450,6 +450,10 @@ public function fieldValidation($fieldName, $metaData, $primaryKey = 'id') {
$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 @@ protected function _magicOptions($options) {
$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'
);

0 comments on commit c0ea3d0

Please sign in to comment.
You can’t perform that action at this time.