當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。