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


PHP Validator::allowEmpty方法代碼示例

本文整理匯總了PHP中Cake\Validation\Validator::allowEmpty方法的典型用法代碼示例。如果您正苦於以下問題:PHP Validator::allowEmpty方法的具體用法?PHP Validator::allowEmpty怎麽用?PHP Validator::allowEmpty使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Cake\Validation\Validator的用法示例。


在下文中一共展示了Validator::allowEmpty方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: validationDefault

 /**
  * Default validation rules.
  *
  * @param \Cake\Validation\Validator $validator Validator instance.
  * @return \Cake\Validation\Validator
  */
 public function validationDefault(Validator $validator)
 {
     $validator->add('id', 'valid', ['rule' => 'numeric'])->allowEmpty('id', 'create');
     $validator->allowEmpty('full_name');
     $validator->allowEmpty('short_name');
     return $validator;
 }
開發者ID:jbronner,項目名稱:prono,代碼行數:13,代碼來源:TeamsTable.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->allowEmpty('image');
     $validator->allowEmpty('image_dir');
     return $validator;
 }
開發者ID:rashmi,項目名稱:newrepo,代碼行數:13,代碼來源:CategoryDetailsTable.php

示例3: validationDefault

 /**
  * Default validation rules.
  *
  * @param \Cake\Validation\Validator $validator Validator instance.
  * @return \Cake\Validation\Validator
  */
 public function validationDefault(Validator $validator)
 {
     $validator->add('id', 'valid', ['rule' => 'numeric'])->allowEmpty('id', 'create');
     $validator->requirePresence('username', 'create')->notEmpty('username');
     $validator->requirePresence('password', 'create')->notEmpty('password');
     $validator->requirePresence('first_name', 'create')->notEmpty('first_name');
     $validator->requirePresence('last_name', 'create')->notEmpty('last_name');
     $validator->allowEmpty('first_name_uk');
     $validator->allowEmpty('last_name_uk');
     $validator->allowEmpty('first_name_ru');
     $validator->allowEmpty('last_name_ru');
     $validator->allowEmpty('phone');
     $validator->add('email', 'valid', ['rule' => 'email'])->requirePresence('email', 'create')->notEmpty('email');
     $validator->allowEmpty('gmail');
     $validator->allowEmpty('skype');
     $validator->allowEmpty('social_fb');
     $validator->add('official', 'valid', ['rule' => 'boolean'])->allowEmpty('official');
     $validator->add('work_start_date', 'valid', ['rule' => 'datetime'])->allowEmpty('work_start_date');
     $validator->add('work_finish_date', 'valid', ['rule' => 'datetime'])->allowEmpty('work_finish_date');
     $validator->add('birthday', 'valid', ['rule' => 'datetime'])->allowEmpty('birthday');
     $validator->allowEmpty('ssh_key');
     $validator->allowEmpty('hash');
     $validator->add('table_num', 'valid', ['rule' => 'numeric'])->allowEmpty('table_num');
     return $validator;
 }
開發者ID:xainse,項目名稱:oxhr,代碼行數:31,代碼來源:UsersTable.php

示例4: validationDefault

 /**
  * Default validation rules.
  *
  * @param \Cake\Validation\Validator $validator Validator instance.
  * @return \Cake\Validation\Validator
  */
 public function validationDefault(Validator $validator)
 {
     $validator->add('ID', 'valid', ['rule' => 'numeric'])->allowEmpty('ID', 'create');
     $validator->allowEmpty('Name');
     $validator->add('FounderNameID', 'valid', ['rule' => 'numeric'])->requirePresence('FounderNameID', 'create')->notEmpty('FounderNameID');
     $validator->add('LeaderID', 'valid', ['rule' => 'numeric'])->requirePresence('LeaderID', 'create')->notEmpty('LeaderID');
     $validator->add('SpecState', 'valid', ['rule' => 'numeric'])->requirePresence('SpecState', 'create')->notEmpty('SpecState');
     $validator->add('Level', 'valid', ['rule' => 'numeric'])->requirePresence('Level', 'create')->notEmpty('Level');
     $validator->add('HoldCity0', 'valid', ['rule' => 'numeric'])->requirePresence('HoldCity0', 'create')->notEmpty('HoldCity0');
     $validator->add('HoldCity1', 'valid', ['rule' => 'numeric'])->requirePresence('HoldCity1', 'create')->notEmpty('HoldCity1');
     $validator->add('HoldCity2', 'valid', ['rule' => 'numeric'])->requirePresence('HoldCity2', 'create')->notEmpty('HoldCity2');
     $validator->add('Fund', 'valid', ['rule' => 'numeric'])->requirePresence('Fund', 'create')->notEmpty('Fund');
     $validator->add('Material', 'valid', ['rule' => 'numeric'])->requirePresence('Material', 'create')->notEmpty('Material');
     $validator->add('Rep', 'valid', ['rule' => 'numeric'])->requirePresence('Rep', 'create')->notEmpty('Rep');
     $validator->add('DailyCost', 'valid', ['rule' => 'numeric'])->requirePresence('DailyCost', 'create')->notEmpty('DailyCost');
     $validator->add('Peace', 'valid', ['rule' => 'numeric'])->requirePresence('Peace', 'create')->notEmpty('Peace');
     $validator->add('Rank', 'valid', ['rule' => 'numeric'])->requirePresence('Rank', 'create')->notEmpty('Rank');
     $validator->allowEmpty('Tenet');
     $validator->allowEmpty('Symbol');
     $validator->add('CreateTime', 'valid', ['rule' => 'datetime'])->requirePresence('CreateTime', 'create')->notEmpty('CreateTime');
     $validator->add('GroupPurchase', 'valid', ['rule' => 'numeric'])->requirePresence('GroupPurchase', 'create')->notEmpty('GroupPurchase');
     $validator->add('RemainSpreadTimes', 'valid', ['rule' => 'numeric'])->requirePresence('RemainSpreadTimes', 'create')->notEmpty('RemainSpreadTimes');
     $validator->add('Commendation', 'valid', ['rule' => 'boolean'])->requirePresence('Commendation', 'create')->notEmpty('Commendation');
     $validator->allowEmpty('DailyRewardTakenTimes');
     $validator->add('GuildValue1', 'valid', ['rule' => 'numeric'])->allowEmpty('GuildValue1');
     $validator->add('GuildValue2', 'valid', ['rule' => 'numeric'])->allowEmpty('GuildValue2');
     return $validator;
 }
開發者ID:GreeNoir,項目名稱:game-wizard,代碼行數:34,代碼來源:GuildTable.php

示例5: validationDefault

 /**
  * Default validation rules.
  *
  * @param \Cake\Validation\Validator $validator Validator instance.
  * @return \Cake\Validation\Validator
  */
 public function validationDefault(Validator $validator)
 {
     $validator->add('id', 'valid', ['rule' => 'numeric'])->allowEmpty('id', 'create');
     $validator->allowEmpty('com_trading_name_vie');
     $validator->allowEmpty('com_short_name_vie');
     $validator->requirePresence('industry_code', 'create')->notEmpty('industry_code');
     $validator->requirePresence('company', 'create')->notEmpty('company');
     $validator->requirePresence('city_code', 'create')->notEmpty('city_code');
     $validator->requirePresence('tel', 'create')->notEmpty('tel');
     //
     //        $validator
     //            ->requirePresence('business', 'create')
     //            ->notEmpty('business');
     //
     //        $validator
     //            ->requirePresence('want_to_get')
     //            ->notEmpty('want_to_get');
     $validator->requirePresence('email', 'create')->add('email', 'validFormat', ['rule' => 'email', 'message' => __('E-mail must be valid')])->notEmpty('email');
     $validator->allowEmpty('image');
     $validator->requirePresence('first_name', 'create')->notEmpty('first_name');
     $validator->requirePresence('last_name', 'create')->notEmpty('last_name');
     $validator->requirePresence('com_lang_chosen', 'create')->notEmpty('com_lang_chosen');
     $validator->requirePresence('division', 'create')->notEmpty('division');
     $validator->requirePresence('com_country', 'create')->notEmpty('com_country');
     $validator->requirePresence('address_vie', 'create')->notEmpty('address_vie');
     $validator->requirePresence('contact_email', 'create')->add('contact_email', 'validFormat', ['rule' => 'email', 'message' => __('E-mail must be valid')])->notEmpty('contact_email');
     $validator->requirePresence('gender', 'create')->notEmpty('gender');
     $validator->requirePresence('mobile', 'create')->notEmpty('mobile');
     $validator->requirePresence('address_vie', 'create')->notEmpty('address_vie');
     return $validator;
 }
開發者ID:nguyennghiem1205,項目名稱:japan-circle,代碼行數:37,代碼來源:MembersTable.php

示例6: 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->allowEmpty('data');
     $validator->integer('expires')->requirePresence('expires', 'create')->notEmpty('expires');
     return $validator;
 }
開發者ID:CubScoutCake,項目名稱:CubEventBooking,代碼行數:13,代碼來源:SessionsTable.php

示例7: validationDefault

 /**
  * Default validation rules.
  *
  * @param \Cake\Validation\Validator $validator Validator instance.
  * @return \Cake\Validation\Validator
  */
 public function validationDefault(Validator $validator)
 {
     $validator->allowEmpty('fitur1');
     $validator->allowEmpty('fitur2');
     $validator->allowEmpty('fitur3');
     return $validator;
 }
開發者ID:unid3ntified,項目名稱:ceksaham,代碼行數:13,代碼來源:UserRightsTable.php

示例8: 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->allowEmpty('name');
     $validator->add('created_date', 'valid', ['rule' => 'datetime'])->allowEmpty('created_date');
     return $validator;
 }
開發者ID:ngdinhbinh,項目名稱:libu,代碼行數:13,代碼來源:CommentsTable.php

示例9: validationDefault

 /**
  * Default validation rules.
  *
  * @param \Cake\Validation\Validator $validator Validator instance.
  *
  * @return \Cake\Validation\Validator
  */
 public function validationDefault(Validator $validator)
 {
     $validator->add('id', 'valid', ['rule' => 'numeric'])->allowEmpty('id', 'create');
     $validator->allowEmpty('source_table_name');
     $validator->allowEmpty('target_table_name');
     return $validator;
 }
開發者ID:aiphee,項目名稱:cakephp-related-content,代碼行數:14,代碼來源:RelatedContentsTable.php

示例10: validationDefault

 /**
  * Default validation rules.
  *
  * @param \Cake\Validation\Validator $validator Validator instance.
  * @return \Cake\Validation\Validator
  */
 public function validationDefault(Validator $validator)
 {
     $validator->add('lotetransporteid', 'valid', ['rule' => 'uuid'])->allowEmpty('lotetransporteid', 'create');
     $validator->add('fk_separacao', 'valid', ['rule' => 'uuid'])->requirePresence('fk_separacao', 'create')->notEmpty('fk_separacao');
     $validator->add('n_transporte', 'valid', ['rule' => 'numeric'])->allowEmpty('n_transporte');
     $validator->add('qtd_colheres_celula', 'valid', ['rule' => 'numeric'])->allowEmpty('qtd_colheres_celula');
     $validator->allowEmpty('cor_lote');
     $validator->add('qtd_c25_completas_envio', 'valid', ['rule' => 'numeric'])->allowEmpty('qtd_c25_completas_envio');
     $validator->add('qtd_c25_incompletas_envio', 'valid', ['rule' => 'numeric'])->allowEmpty('qtd_c25_incompletas_envio');
     $validator->allowEmpty('hora_entrada_bod');
     $validator->allowEmpty('hora_saida_upat');
     $validator->allowEmpty('hora_saida_moscamed');
     $validator->allowEmpty('nome_motorista');
     $validator->allowEmpty('nome_supervisor_envio');
     $validator->add('data_recebimento', 'valid', ['rule' => 'date'])->allowEmpty('data_recebimento');
     $validator->allowEmpty('hora_chegada_lemi');
     $validator->add('qtd_c25_completas_recebimento', 'valid', ['rule' => 'numeric'])->allowEmpty('qtd_c25_completas_recebimento');
     $validator->add('qtd_celulas_incompletas_recebimento', 'valid', ['rule' => 'numeric'])->allowEmpty('qtd_celulas_incompletas_recebimento');
     $validator->allowEmpty('nome_encarregado_montagem_rd11');
     $validator->allowEmpty('hora_inicio_montagem_rd11');
     $validator->allowEmpty('hora_termino_montagem_rd11');
     $validator->add('qnt_celula_rd11', 'valid', ['rule' => 'numeric'])->allowEmpty('qnt_celula_rd11');
     $validator->add('qnt_rd11_montadas', 'valid', ['rule' => 'numeric'])->allowEmpty('qnt_rd11_montadas');
     $validator->add('qnt_total_machos_enviados', 'valid', ['rule' => 'numeric'])->allowEmpty('qnt_total_machos_enviados');
     return $validator;
 }
開發者ID:JohnathanALves,項目名稱:Final,代碼行數:32,代碼來源:LotetransporteTable.php

示例11: 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->allowEmpty('dhr_entrada');
     $validator->allowEmpty('dhr_saida');
     return $validator;
 }
開發者ID:eversonjjo,項目名稱:sce,代碼行數:13,代碼來源:PresencasTable.php

示例12: 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

示例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')->add('id', 'unique', ['rule' => 'validateUnique', 'provider' => 'table']);
     $validator->allowEmpty('url');
     $validator->allowEmpty('slug')->add('slug', 'unique', ['rule' => 'validateUnique', 'provider' => 'table']);
     return $validator;
 }
開發者ID:sylwesterkowal,項目名稱:plugin.cakephp-slug,代碼行數:13,代碼來源:SlugsTable.php

示例14: validationDefault

 public function validationDefault(Validator $validator)
 {
     $validator->allowEmpty('id', 'create');
     $validator->notEmpty('player_id');
     $validator->notEmpty('chin');
     $validator->notEmpty('name');
     $validator->notEmpty('xp');
     $validator->notEmpty('faction_id');
     $validator->notEmpty('belief_id');
     $validator->notEmpty('group_id');
     $validator->notEmpty('world_id');
     $validator->allowEmpty('soulpath');
     $validator->notEmpty('status');
     $validator->allowEmpty('comments');
     $validator->add('id', 'valid', ['rule' => 'numeric']);
     $validator->add('player_id', 'valid', ['rule' => 'numeric']);
     $validator->add('chin', 'valid', ['rule' => 'naturalNumber']);
     $validator->add('xp', 'valid', ['rule' => ['custom', '/^[0-9]*([\\.][05])?$/']]);
     $validator->add('faction_id', 'valid', ['rule' => 'numeric']);
     $validator->add('belief_id', 'valid', ['rule' => 'numeric']);
     $validator->add('group_id', 'valid', ['rule' => 'numeric']);
     $validator->add('world_id', 'valid', ['rule' => 'numeric']);
     $validator->add('soulpath', 'valid', ['rule' => ['inList', Character::soulpathValues()]]);
     $validator->add('status', 'valid', ['rule' => ['inList', Character::statusValues()]]);
     $validator->requirePresence('player_id', 'create');
     $validator->requirePresence('chin', 'create');
     $validator->requirePresence('name', 'create');
     return $validator;
 }
開發者ID:pwerken,項目名稱:va-void,代碼行數:29,代碼來源:CharactersTable.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->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


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