本文整理汇总了PHP中Cake\Validation\Validator::numeric方法的典型用法代码示例。如果您正苦于以下问题:PHP Validator::numeric方法的具体用法?PHP Validator::numeric怎么用?PHP Validator::numeric使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cake\Validation\Validator
的用法示例。
在下文中一共展示了Validator::numeric方法的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');
$validator->integer('numero_nota_fiscal')->allowEmpty('numero_nota_fiscal');
$validator->allowEmpty('serie');
$validator->date('data_emissao')->allowEmpty('data_emissao');
$validator->date('data_saida')->allowEmpty('data_saida');
$validator->allowEmpty('hora_saida');
$validator->numeric('total_produtos')->allowEmpty('total_produtos');
$validator->numeric('total_nota')->allowEmpty('total_nota');
$validator->numeric('base_icms')->allowEmpty('base_icms');
$validator->numeric('valor_icms')->allowEmpty('valor_icms');
$validator->integer('cancelada')->allowEmpty('cancelada');
$validator->date('data_cancelada')->allowEmpty('data_cancelada');
$validator->integer('numero_pedido')->allowEmpty('numero_pedido');
$validator->integer('frete')->allowEmpty('frete');
$validator->integer('qtde_volumes')->allowEmpty('qtde_volumes');
$validator->allowEmpty('especie');
$validator->numeric('base_st')->allowEmpty('base_st');
$validator->numeric('valor_st')->allowEmpty('valor_st');
$validator->numeric('base_credito')->allowEmpty('base_credito');
$validator->numeric('valor_credito')->allowEmpty('valor_credito');
$validator->numeric('percentual_tributo')->allowEmpty('percentual_tributo');
$validator->numeric('valor_tributo')->allowEmpty('valor_tributo');
$validator->integer('operacao')->allowEmpty('operacao');
$validator->integer('atendimento')->allowEmpty('atendimento');
$validator->allowEmpty('data_hora');
return $validator;
}
示例2: validationDefault
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator->numeric('id')->allowEmpty('id', 'create');
$validator->numeric('quantity')->allowEmpty('quantity');
$validator->numeric('value')->allowEmpty('value');
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')->requirePresence('tract_id', 'create');
$validator->numeric('little_amount')->requirePresence('little_amount', 'create')->notEmpty('little_amount')->add('little_amount', 'validFormat', ['rule' => array('custom', '/^[0-9\\,\\.]+$/'), 'message' => 'Formato inválido. Solo números.']);
$validator->numeric('big_amount')->requirePresence('big_amount', 'create')->notEmpty('big_amount')->add('big_amount', 'validFormat', ['rule' => array('custom', '/^[0-9\\,\\.]+$/'), 'message' => 'Formato inválido. Solo números.']);
$validator->integer('type')->requirePresence('type', 'create')->notEmpty('type');
return $validator;
}
示例4: validationDefault
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator->numeric('id')->allowEmpty('id', 'create');
$validator->allowEmpty('name');
$validator->allowEmpty('icon');
$validator->numeric('icon_display_size')->allowEmpty('icon_display_size');
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->numeric('qtde')->allowEmpty('qtde');
$validator->numeric('compra')->allowEmpty('compra');
$validator->numeric('total')->allowEmpty('total');
return $validator;
}
示例6: validationDefault
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator->numeric('id')->allowEmpty('id', 'create');
$validator->numeric('step')->allowEmpty('step');
$validator->numeric('distance')->allowEmpty('distance');
$validator->numeric('delay')->allowEmpty('delay');
return $validator;
}
示例7: validationDefault
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator->numeric('id')->allowEmpty('id', 'create');
$validator->allowEmpty('name');
$validator->allowEmpty('item_supply_border_color');
$validator->numeric('item_supply_border_thickness')->allowEmpty('item_supply_border_thickness');
$validator->allowEmpty('item_demand_border_color');
$validator->numeric('item_demand_border_thickness')->allowEmpty('item_demand_border_thickness');
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->allowEmpty('nome');
$validator->allowEmpty('unidade');
$validator->allowEmpty('grupo');
$validator->numeric('estoque')->allowEmpty('estoque');
$validator->numeric('compra')->allowEmpty('compra');
$validator->numeric('valor')->allowEmpty('valor');
$validator->numeric('total')->allowEmpty('total');
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->requirePresence('name', 'create')->notEmpty('name');
$validator->date('begin')->requirePresence('begin', 'create')->notEmpty('begin');
$validator->date('end')->requirePresence('end', 'create')->notEmpty('end');
$validator->requirePresence('notes', 'create')->notEmpty('notes');
$validator->numeric('total')->requirePresence('total', 'create')->notEmpty('total');
$validator->numeric('paid')->requirePresence('paid', 'create')->notEmpty('paid');
$validator->numeric('rest')->requirePresence('rest', 'create')->notEmpty('rest');
$validator->requirePresence('invoice', 'create')->notEmpty('invoice');
return $validator;
}
示例10: validationDefault
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator->numeric('id')->allowEmpty('id', 'create');
$validator->allowEmpty('name');
$validator->allowEmpty('background_color');
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->date('date')->allowEmpty('date');
$validator->numeric('budget')->allowEmpty('budget');
return $validator;
}
示例12: validationDefault
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator->allowEmpty('id', 'create')->add('id', 'unique', ['rule' => 'validateUnique', 'provider' => 'table']);
$validator->requirePresence('uuid', 'create')->notEmpty('uuid');
$validator->numeric('value')->requirePresence('value', 'create')->notEmpty('value');
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->requirePresence('name', 'create')->notEmpty('name');
$validator->numeric('rate')->requirePresence('rate', 'create')->notEmpty('rate');
return $validator;
}
示例14: validationDefault
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator->allowEmpty('language', 'create');
$validator->boolean('is_official')->requirePresence('is_official', 'create')->notEmpty('is_official');
$validator->numeric('percentage')->requirePresence('percentage', 'create')->notEmpty('percentage');
return $validator;
}
示例15: 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->numeric('amount')->requirePresence('amount', 'create')->notEmpty('amount')->add('amount', 'validFormat', ['rule' => array('custom', '/^[0-9\\,\\.]+$/'), 'message' => 'Formato inválido.']);
$validator->requirePresence('detail', 'create')->notEmpty('detail')->add('detail', 'validFormat', ['rule' => array('custom', '/^[A-Za-z0-9" "\\,\\.\\-\\:áéíóúÁÉÍÓÚñÑ\\[\\]\\(\\)\\"]+$/'), 'message' => 'Formato inválido.']);
return $validator;
}