本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}