當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Validator::numeric方法代碼示例

本文整理匯總了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;
 }
開發者ID:lucasnpinheiro,項目名稱:Kiterp,代碼行數:35,代碼來源:NotasFiscaisSaidasTable.php

示例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;
 }
開發者ID:vorien,項目名稱:supplyanddemand,代碼行數:13,代碼來源:LocationInventoriesTable.php

示例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;
 }
開發者ID:raguilar0,項目名稱:TCU_FEUCR,代碼行數:14,代碼來源:BoxesTable.php

示例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;
 }
開發者ID:vorien,項目名稱:supplyanddemand,代碼行數:14,代碼來源:ItemsTable.php

示例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;
 }
開發者ID:lucasnpinheiro,項目名稱:Kiterp,代碼行數:14,代碼來源:NotasFiscaisEntradasItensTable.php

示例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;
 }
開發者ID:vorien,項目名稱:supplyanddemand,代碼行數:14,代碼來源:StepsTable.php

示例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;
 }
開發者ID:vorien,項目名稱:supplyanddemand,代碼行數:16,代碼來源:UserPreferencesTable.php

示例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;
 }
開發者ID:lucasnpinheiro,項目名稱:Kiterp,代碼行數:18,代碼來源:InventariosTable.php

示例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;
 }
開發者ID:AdBouli,項目名稱:hotel-manager,代碼行數:19,代碼來源:ReservationsTable.php

示例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;
 }
開發者ID:vorien,項目名稱:supplyanddemand,代碼行數:13,代碼來源:GradesTable.php

示例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;
 }
開發者ID:randompherret,項目名稱:paperbudget,代碼行數:13,代碼來源:MonthliesTable.php

示例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;
 }
開發者ID:MoosemanStudios,項目名稱:api.moosecraft.us,代碼行數:13,代碼來源:StatsJoinsTable.php

示例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;
 }
開發者ID:AdBouli,項目名稱:hotel-manager,代碼行數:13,代碼來源:ProductsTable.php

示例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;
 }
開發者ID:AFPA-Dijon,項目名稱:afpa,代碼行數:13,代碼來源:LanguagesTable.php

示例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;
 }
開發者ID:raguilar0,項目名稱:TCU_FEUCR,代碼行數:13,代碼來源:SurplusesTable.php


注:本文中的Cake\Validation\Validator::numeric方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。