本文整理汇总了PHP中Cake\Validation\Validator::add方法的典型用法代码示例。如果您正苦于以下问题:PHP Validator::add方法的具体用法?PHP Validator::add怎么用?PHP Validator::add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cake\Validation\Validator
的用法示例。
在下文中一共展示了Validator::add方法的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('Registration_ID', 'valid', ['rule' => 'numeric'])->allowEmpty('Registration_ID', 'create');
$validator->add('Student_ID', 'valid', ['rule' => 'numeric'])->requirePresence('Student_ID', 'create')->notEmpty('Student_ID');
$validator->add('Exam_ID', 'valid', ['rule' => 'numeric'])->requirePresence('Exam_ID', 'create')->notEmpty('Exam_ID');
$validator->allowEmpty('Outcome');
$validator->add('Date_Materials_Sent', 'valid', ['rule' => 'date'])->allowEmpty('Date_Materials_Sent');
$validator->allowEmpty('Retest');
$validator->allowEmpty('Payer_Name');
$validator->allowEmpty('Payment_Type');
$validator->allowEmpty('Check_Number');
$validator->add('Check_Date', 'valid', ['rule' => 'date'])->allowEmpty('Check_Date');
$validator->allowEmpty('Check_Name');
$validator->allowEmpty('Verisign_Transaction_Number');
$validator->allowEmpty('Verisign_Address_Line1');
$validator->allowEmpty('Verisign_Address_Line2');
$validator->add('Payment_Code_ID', 'valid', ['rule' => 'numeric'])->allowEmpty('Payment_Code_ID');
$validator->requirePresence('Payment_Execution_Date_Time', 'create')->notEmpty('Payment_Execution_Date_Time');
$validator->add('Amount_Charged', 'valid', ['rule' => 'decimal'])->allowEmpty('Amount_Charged');
$validator->add('Amount_Paid', 'valid', ['rule' => 'decimal'])->allowEmpty('Amount_Paid');
$validator->allowEmpty('Disability_Accomodations');
$validator->allowEmpty('Alternate_Test_Site_Requirement');
$validator->allowEmpty('Location');
$validator->allowEmpty('Registration_Complete_Flag');
$validator->allowEmpty('Mail_Confirmation');
$validator->allowEmpty('Status');
$validator->add('Date_Passed', 'valid', ['rule' => 'date'])->allowEmpty('Date_Passed');
$validator->add('Raw_Passing_Score', 'valid', ['rule' => 'numeric'])->allowEmpty('Raw_Passing_Score');
$validator->allowEmpty('Required_Non_Saturday_Admission');
$validator->allowEmpty('Release_Contact_Info_To_Others');
$validator->allowEmpty('Note');
$validator->requirePresence('Last_Update', 'create')->notEmpty('Last_Update');
return $validator;
}
示例2: 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->add('email', 'valid', ['rule' => 'email'])->requirePresence('email', 'create')->notEmpty('email');
$validator->requirePresence('password', 'create')->notEmpty('password');
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('name', 'create')->notEmpty('name');
$validator->add('active', 'valid', ['rule' => 'boolean'])->requirePresence('active', 'create')->notEmpty('active');
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->add('created_at', 'valid', ['rule' => 'datetime'])->allowEmpty('created_at');
$validator->add('updated_at', 'valid', ['rule' => 'datetime'])->allowEmpty('updated_at');
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->add('from_date', 'valid', ['rule' => 'date'])->requirePresence('from_date', 'create')->notEmpty('from_date');
$validator->add('to_date', 'valid', ['rule' => 'date'])->requirePresence('to_date', 'create')->notEmpty('to_date');
return $validator;
}
示例6: 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('opestado');
$validator->add('order', 'valid', ['rule' => 'numeric'])->allowEmpty('order')->add('order', 'unique', ['rule' => 'validateUnique', 'provider' => 'table']);
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('title', 'create');
$validator->add('from_date', 'valid', ['rule' => 'date'])->allowEmpty('from_date', 'create');
$validator->add('to_date', 'valid', ['rule' => 'date'])->allowEmpty('to_date');
return $validator;
}
示例8: validationDefault
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator->requirePresence('id', 'create')->notEmpty('id');
$validator->add('lat', 'valid', ['rule' => 'numeric'])->requirePresence('lat', 'create')->notEmpty('lat');
$validator->add('lng', 'valid', ['rule' => 'numeric'])->requirePresence('lng', 'create')->notEmpty('lng');
$validator->allowEmpty('info');
$validator->allowEmpty('twitID');
$validator->allowEmpty('twitPlaceID');
$validator->add('twitTime', 'valid', ['rule' => 'datetime'])->allowEmpty('twitTime');
$validator->allowEmpty('twitURL');
$validator->allowEmpty('twitPlaceName');
$validator->add('isTwitPlacePrecise', 'valid', ['rule' => 'boolean'])->requirePresence('isTwitPlacePrecise', 'create')->notEmpty('isTwitPlacePrecise');
$validator->allowEmpty('twitImage');
$validator->add('pinned', 'valid', ['rule' => 'boolean'])->requirePresence('pinned', 'create')->notEmpty('pinned');
$validator->add('cleared', 'valid', ['rule' => 'boolean'])->requirePresence('cleared', 'create')->notEmpty('cleared');
$validator->add('active', 'valid', ['rule' => 'boolean'])->requirePresence('active', 'create')->notEmpty('active');
$validator->allowEmpty('category_name');
$validator->allowEmpty('twitUserID');
$validator->allowEmpty('respondent_name');
$validator->allowEmpty('respondent_contact');
$validator->allowEmpty('place_name');
$validator->add('isTwitImageExist', 'valid', ['rule' => 'numeric'])->requirePresence('isTwitImageExist', 'create')->notEmpty('isTwitImageExist');
$validator->add('isTwitURLExist', 'valid', ['rule' => 'numeric'])->requirePresence('isTwitURLExist', 'create')->notEmpty('isTwitURLExist');
$validator->add('isPlaceNameExist', 'valid', ['rule' => 'numeric'])->requirePresence('isPlaceNameExist', 'create')->notEmpty('isPlaceNameExist');
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->add('age', 'valid', ['rule' => 'numeric'])->allowEmpty('age');
$validator->add('name', 'valid', ['rule' => 'notBlank']);
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('id', 'valid', ['rule' => 'numeric'])->allowEmpty('id', 'create');
$validator->requirePresence('first_name', 'create')->notEmpty('first_name');
$validator->requirePresence('last_name', 'create')->notEmpty('last_name');
$validator->add('birthdate', 'valid', ['rule' => 'date'])->requirePresence('birthdate', 'create')->notEmpty('birthdate');
$validator->requirePresence('identity_card', 'create')->notEmpty('identity_card');
$validator->add('email', 'valid', ['rule' => 'email'])->requirePresence('email', 'create')->notEmpty('email');
$validator->add('phone', 'valid', ['rule' => 'validatePhone', 'message' => __('Phone is not valid'), 'provider' => 'table'])->requirePresence('phone', 'create')->notEmpty('phone');
$validator->requirePresence('city_code', 'create')->notEmpty('city_code');
$validator->requirePresence('category_supporter_id', 'create')->notEmpty('category_supporter_id');
$validator->requirePresence('experience', 'create')->notEmpty('experience');
$validator->allowEmpty('district_code');
$validator->allowEmpty('url_facebook');
$validator->allowEmpty('site_url');
$validator->requirePresence('company_name', 'create')->notEmpty('company_name');
$validator->requirePresence('company_address', 'create')->notEmpty('company_address');
$validator->allowEmpty('company_site_url');
$validator->requirePresence('industry_code', 'create')->notEmpty('industry_code');
$validator->add('com_staff', 'valid', ['rule' => 'numeric'])->requirePresence('com_staff', 'create')->notEmpty('com_staff');
$validator->requirePresence('com_lang_chosen', 'create')->notEmpty('com_lang_chosen');
$validator->requirePresence('member_organize', 'create')->notEmpty('member_organize');
$validator->allowEmpty('support_info');
return $validator;
}
示例11: 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->add('user_requesting', 'valid', ['rule' => 'numeric'])->allowEmpty('user_requesting', 'create');
$validator->add('user_requested', 'valid', ['rule' => 'numeric'])->allowEmpty('user_requested', 'create');
return $validator;
}
示例12: 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->add('valor', 'valid', ['rule' => 'numeric'])->allowEmpty('valor');
$validator->allowEmpty('estadorec');
return $validator;
}
示例13: 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->add('tipo_documento', 'valid', ['rule' => 'numeric'])->requirePresence('tipo_documento', 'create')->notEmpty('tipo_documento');
$validator->allowEmpty('numero_documento');
$validator->requirePresence('primer_nombre', 'create')->notEmpty('primer_nombre');
$validator->allowEmpty('segundo_nombre');
$validator->requirePresence('primer_apellido', 'create')->notEmpty('primer_apellido');
$validator->allowEmpty('segundo_apellido');
$validator->allowEmpty('genero');
$validator->requirePresence('usuario', 'create')->notEmpty('usuario');
$validator->requirePresence('pass', 'create')->notEmpty('pass');
$validator->add('email', 'valid', ['rule' => 'email'])->requirePresence('email', 'create')->notEmpty('email');
$validator->requirePresence('telefono', 'create')->notEmpty('telefono');
$validator->add('id_ciudad', 'valid', ['rule' => 'numeric'])->requirePresence('id_ciudad', 'create')->notEmpty('id_ciudad');
$validator->allowEmpty('direccion');
$validator->add('fecha_nacimiento', 'valid', ['rule' => 'date'])->requirePresence('fecha_nacimiento', 'create')->notEmpty('fecha_nacimiento');
$validator->allowEmpty('foto');
$validator->add('estado', 'valid', ['rule' => 'numeric'])->allowEmpty('estado');
$validator->add('fecha_inicio', 'valid', ['rule' => 'datetime'])->requirePresence('fecha_inicio', 'create')->notEmpty('fecha_inicio');
$validator->add('codigo', 'valid', ['rule' => 'numeric'])->allowEmpty('codigo');
$validator->add('create_at', 'valid', ['rule' => 'datetime'])->requirePresence('create_at', 'create')->notEmpty('create_at');
$validator->add('update_at', 'valid', ['rule' => 'datetime'])->requirePresence('update_at', 'create')->notEmpty('update_at');
return $validator;
}
示例14: 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('title', 'create')->notEmpty('title')->add('title', 'unique', ['rule' => 'validateUnique', 'provider' => 'table']);
$validator->add('senior_year', 'valid', ['rule' => 'numeric'])->requirePresence('senior_year', 'create')->notEmpty('senior_year');
return $validator;
}
示例15: validationDefault
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator->requirePresence('nombre', 'create')->notEmpty('nombre');
$validator->add('nro_integrantes', 'valid', ['rule' => 'numeric'])->allowEmpty('nro_integrantes');
$validator->add('id', 'valid', ['rule' => 'numeric'])->allowEmpty('id', 'create');
return $validator;
}