当前位置: 首页>>代码示例>>PHP>>正文


PHP Validator::integer方法代码示例

本文整理汇总了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;
 }
开发者ID:raguilar0,项目名称:TCU_FEUCR,代码行数:13,代码来源:InitialAmountsTable.php

示例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;
 }
开发者ID:Moggers,项目名称:blitzserver,代码行数:13,代码来源:EmailrequestsTable.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');
     $validator->integer('quantity')->requirePresence('quantity', 'create')->notEmpty('quantity');
     $validator->numeric('total')->requirePresence('total', 'create')->notEmpty('total');
     return $validator;
 }
开发者ID:AdBouli,项目名称:hotel-manager,代码行数:13,代码来源:OrderLinesTable.php

示例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;
 }
开发者ID:AFPA-Dijon,项目名称:afpa,代码行数:13,代码来源:HashtagsTable.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->requirePresence('name', 'create')->notEmpty('name')->add('name', 'unique', ['rule' => 'validateUnique', 'provider' => 'table']);
     $validator->integer('counter')->requirePresence('counter', 'create')->notEmpty('counter');
     return $validator;
 }
开发者ID:AFPA-Dijon,项目名称:afpa,代码行数:13,代码来源:HashtagsTable.php

示例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;
 }
开发者ID:lucasnpinheiro,项目名称:Kiterp,代码行数:13,代码来源:CaixasDiariosTable.php

示例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;
 }
开发者ID:didisky,项目名称:projectsurvey,代码行数:14,代码来源:PropositionsTable.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->requirePresence('option_key', 'create')->notEmpty('option_key');
     $validator->requirePresence('option_value', 'create')->notEmpty('option_value');
     $validator->integer('menu_order')->allowEmpty('menu_order');
     return $validator;
 }
开发者ID:aoliverio,项目名称:content,代码行数:14,代码来源:CmsSiteOptionsTable.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->integer('lft')->allowEmpty('lft');
     $validator->integer('rght')->allowEmpty('rght');
     $validator->allowEmpty('name');
     return $validator;
 }
开发者ID:rashmi,项目名称:newrepo,代码行数:14,代码来源:CategoriesTable.php

示例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;
 }
开发者ID:richellyitalo,项目名称:estudoscakephp,代码行数:14,代码来源:PropertiesTable.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->integer('status')->allowEmpty('status');
     $validator->add('valor', 'valid', ['rule' => 'money'])->allowEmpty('valor');
     $validator->allowEmpty('descricao');
     return $validator;
 }
开发者ID:lucasnpinheiro,项目名称:Kiterp,代码行数:14,代码来源:CaixasMovimentosTable.php

示例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;
 }
开发者ID:LPFP,项目名称:donjon,代码行数:14,代码来源:UnitsTable.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->integer('data1')->requirePresence('data1', 'create')->notEmpty('data1');
     $validator->numeric('data2')->allowEmpty('data2');
     $validator->allowEmpty('data3');
     return $validator;
 }
开发者ID:KimiyukiYamauchi,项目名称:phppro.2015,代码行数:14,代码来源:SamplesTable.php

示例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;
 }
开发者ID:raguilar0,项目名称:TCU_FEUCR,代码行数:14,代码来源:TractsTable.php

示例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;
 }
开发者ID:Multicoin-co,项目名称:PHP-WebStore,代码行数:14,代码来源:OrderItemsTable.php


注:本文中的Cake\Validation\Validator::integer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。