本文整理汇总了PHP中Cake\Validation\Validator::integer方法的典型用法代码示例。如果您正苦于以下问题:PHP Validator::integer方法的具体用法?PHP Validator::integer怎么用?PHP Validator::integer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cake\Validation\Validator
的用法示例。
在下文中一共展示了Validator::integer方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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')->requirePresence('tract_id', 'create')->add('tract_id', 'validFormat', ['rule' => array('custom', '/^[0-9]+$/'), 'message' => 'Formato inválido. Solo números.']);
$validator->numeric('amount')->requirePresence('amount', 'create')->notEmpty('amount')->add('amount', 'validFormat', ['rule' => array('custom', '/^[0-9\\,\\.]+$/'), 'message' => 'Formato inválido. Solo números.']);
$validator->integer('type')->requirePresence('type', 'create')->notEmpty('type');
return $validator;
}
示例2: 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('email', 'create')->notEmpty('email');
$validator->integer('hours')->allowEmpty('hours');
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->integer('quantity')->requirePresence('quantity', 'create')->notEmpty('quantity');
$validator->numeric('total')->requirePresence('total', 'create')->notEmpty('total');
return $validator;
}
示例4: 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('name', 'create')->notEmpty('name');
$validator->integer('counter')->requirePresence('counter', 'create')->notEmpty('counter');
return $validator;
}
示例5: 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('name', 'create')->notEmpty('name')->add('name', 'unique', ['rule' => 'validateUnique', 'provider' => 'table']);
$validator->integer('counter')->requirePresence('counter', 'create')->notEmpty('counter');
return $validator;
}
示例6: 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->add('data', 'validFormat', ['rule' => ['date', 'dmy']])->allowEmpty('data');
$validator->integer('status')->allowEmpty('status');
return $validator;
}
示例7: 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('proposition', 'create')->notEmpty('proposition');
$validator->allowEmpty('etat_objet');
$validator->integer('compteur')->allowEmpty('compteur');
return $validator;
}
示例8: 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('option_key', 'create')->notEmpty('option_key');
$validator->requirePresence('option_value', 'create')->notEmpty('option_value');
$validator->integer('menu_order')->allowEmpty('menu_order');
return $validator;
}
示例9: 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->integer('lft')->allowEmpty('lft');
$validator->integer('rght')->allowEmpty('rght');
$validator->allowEmpty('name');
return $validator;
}
示例10: 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('titulo', 'create')->notEmpty('titulo');
$validator->requirePresence('endereco', 'create')->notEmpty('endereco');
$validator->integer('quartos')->requirePresence('quartos', 'create')->notEmpty('quartos');
return $validator;
}
示例11: 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->integer('status')->allowEmpty('status');
$validator->add('valor', 'valid', ['rule' => 'money'])->allowEmpty('valor');
$validator->allowEmpty('descricao');
return $validator;
}
示例12: 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('infos', 'create')->notEmpty('infos');
$validator->integer('status')->requirePresence('status', 'create')->notEmpty('status');
$validator->requirePresence('uuid', 'create')->notEmpty('uuid');
return $validator;
}
示例13: 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->integer('data1')->requirePresence('data1', 'create')->notEmpty('data1');
$validator->numeric('data2')->allowEmpty('data2');
$validator->allowEmpty('data3');
return $validator;
}
示例14: 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->integer('number')->requirePresence('number', 'create')->notEmpty('number')->add('number', 'validFormat', ['rule' => array('custom', '/^[1-4]$/'), 'message' => 'Solo números entre 1 y 4']);
$validator->date('date')->requirePresence('date', 'create')->notEmpty('date');
$validator->date('deadline')->requirePresence('deadline', 'create')->notEmpty('deadline');
return $validator;
}
示例15: 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;
}