本文整理汇总了PHP中Cake\Validation\Validator::decimal方法的典型用法代码示例。如果您正苦于以下问题:PHP Validator::decimal方法的具体用法?PHP Validator::decimal怎么用?PHP Validator::decimal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cake\Validation\Validator
的用法示例。
在下文中一共展示了Validator::decimal方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: validationDefault
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator->integer('id')->allowEmpty('id', 'create');
$validator->requirePresence('address', 'create')->notEmpty('address')->add('address', 'unique', ['rule' => 'validateUnique', 'provider' => 'table']);
$validator->allowEmpty('formatted_address');
$validator->allowEmpty('country');
$validator->decimal('lat')->allowEmpty('lat');
$validator->decimal('lng')->allowEmpty('lng');
$validator->allowEmpty('data');
return $validator;
}
示例2: validationDefault
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator->allowEmpty('id', 'create');
$validator->integer('quantity')->requirePresence('quantity', 'create')->notEmpty('quantity');
$validator->decimal('price')->requirePresence('price', 'create')->notEmpty('price');
$validator->integer('status')->requirePresence('status', 'create')->notEmpty('status');
return $validator;
}
示例3: validationDefault
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator->integer('id')->allowEmpty('id', 'create');
$validator->requirePresence('nombre', 'create')->notEmpty('nombre');
$validator->requirePresence('apellido', 'create')->notEmpty('apellido');
$validator->requirePresence('password', 'create')->notEmpty('password');
$validator->date('fecha_nacimiento')->requirePresence('fecha_nacimiento', 'create')->notEmpty('fecha_nacimiento');
$validator->email('email')->requirePresence('email', 'create')->notEmpty('email');
$validator->requirePresence('telefono', 'create')->notEmpty('telefono');
$validator->integer('num_natricula')->requirePresence('num_natricula', 'create')->notEmpty('num_natricula');
$validator->decimal('nota_selectividad')->requirePresence('nota_selectividad', 'create')->notEmpty('nota_selectividad');
return $validator;
}
示例4: validationDefault
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator->allowEmpty('id', 'create');
$validator->requirePresence('fkProductSubTypeID', 'create')->notEmpty('fkProductSubTypeID');
$validator->requirePresence('name', 'create')->notEmpty('name');
$validator->requirePresence('description', 'create')->notEmpty('description');
$validator->requirePresence('Manufacturer', 'create')->notEmpty('Manufacturer');
$validator->decimal('price')->requirePresence('price', 'create')->notEmpty('price');
$validator->requirePresence('stock', 'create')->notEmpty('stock');
$validator->integer('status')->requirePresence('status', 'create')->notEmpty('status');
$validator->dateTime('date_added')->requirePresence('date_added', 'create')->notEmpty('date_added');
$validator->dateTime('date_modified')->requirePresence('date_modified', 'create')->notEmpty('date_modified');
return $validator;
}