本文整理汇总了PHP中Cake\Validation\Validator::uuid方法的典型用法代码示例。如果您正苦于以下问题:PHP Validator::uuid方法的具体用法?PHP Validator::uuid怎么用?PHP Validator::uuid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cake\Validation\Validator
的用法示例。
在下文中一共展示了Validator::uuid方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: validationDefault
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator->uuid('id')->allowEmpty('id', 'create');
$validator->requirePresence('name', 'create')->notEmpty('name');
$validator->boolean('active')->allowEmpty('active');
return $validator;
}
示例2: validationDefault
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator->uuid('id')->allowEmpty('id', 'create');
$validator->allowEmpty('label');
$validator->allowEmpty('url');
$validator->boolean('new_window')->allowEmpty('new_window');
return $validator;
}
示例3: validationDefault
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator->uuid('id')->allowEmpty('id', 'create');
$validator->requirePresence('text', 'create')->notEmpty('text');
$validator->boolean('sfw')->requirePresence('sfw', 'create')->notEmpty('sfw');
$validator->integer('status')->requirePresence('status', 'create')->notEmpty('status');
return $validator;
}
示例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('model', 'create')->notEmpty('model');
$validator->uuid('fkid')->requirePresence('fkid', 'create')->notEmpty('fkid');
$validator->requirePresence('type', 'create')->notEmpty('type');
return $validator;
}
示例5: validationDefault
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator->uuid('id')->allowEmpty('id', 'create');
$validator->requirePresence('title', 'create')->notEmpty('title');
$validator->requirePresence('excerpt', 'create')->notEmpty('excerpt')->add('excerpt', ['maxLength' => ['rule' => ['maxLength', 250], 'message' => 'Excerpts cannot be too long.']]);
$validator->allowEmpty('text');
$validator->boolean('sfw')->requirePresence('sfw', 'create')->notEmpty('sfw');
$validator->integer('status')->requirePresence('status', 'create')->notEmpty('status');
$validator->dateTime('publication_date')->allowEmpty('publication_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->integer('id')->allowEmpty('id', 'create');
$validator->requirePresence('model', 'create')->notEmpty('model');
$validator->uuid('fkid')->requirePresence('fkid', 'create')->notEmpty('fkid');
$validator->requirePresence('name', 'create')->notEmpty('name');
$validator->email('email')->requirePresence('email', 'create')->notEmpty('email');
$validator->boolean('allow_contact')->requirePresence('allow_contact', 'create')->notEmpty('allow_contact');
$validator->requirePresence('message', 'create')->notEmpty('message');
return $validator;
}
示例7: validationDefault
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator->uuid('id')->allowEmpty('id', 'create');
$validator->requirePresence('name', 'create')->notEmpty('name');
$validator->allowEmpty('short_description');
$validator->allowEmpty('description');
$validator->allowEmpty('mainurl');
$validator->boolean('sfw')->requirePresence('sfw', 'create')->notEmpty('sfw');
$validator->integer('status')->requirePresence('status', 'create')->notEmpty('status');
return $validator;
}
示例8: validationDefault
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator->uuid('id')->allowEmpty('id', 'create');
$validator->requirePresence('status', 'create')->notEmpty('status');
$validator->requirePresence('role', 'create')->notEmpty('role');
$validator->requirePresence('firstname', 'create')->notEmpty('firstname');
$validator->requirePresence('lastname', 'create')->notEmpty('lastname');
$validator->email('email')->requirePresence('email', 'create')->notEmpty('email');
$validator->allowEmpty('password', 'update');
$this->validationPassword($validator);
$validator->integer('failed_login_count')->requirePresence('failed_login_count', 'create')->notEmpty('failed_login_count');
$validator->dateTime('failed_login_timestamp')->allowEmpty('failed_login_timestamp');
$validator->allowEmpty('api_token');
$validator->allowEmpty('last_passwords');
return $validator;
}
示例9: validationDefault
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator->uuid('id')->allowEmpty('id', 'create');
$validator->email('email')->requirePresence('email', 'create')->notEmpty('email', 'Your email is needed for login');
$validator->requirePresence('username', 'create')->notEmpty('username', 'You should provide a user name')->add('username', ['minLength' => ['rule' => ['minLength', Configure::read('cms.defaultMinUserNameLenght')], 'message' => sprintf('User names must be %d characters min.', Configure::read('cms.defaultMinUserNameLenght'))]]);
$validator->allowEmpty('realname');
$validator->requirePresence('password', 'create')->notEmpty('password', 'Without a password, you can\'t login.')->add('password', ['minLength' => ['rule' => ['minLength', Configure::read('cms.defaultMinPassLenght')], 'message' => sprintf('Passwords must be %d characters min.', Configure::read('cms.defaultMinPassLenght'))]])->add('password', 'compare', ['rule' => function ($value, $context) {
return $value === $context['data']['password_confirm'];
}, 'message' => __d('elabs', 'Your password does not match your confirm password. Please try again'), 'on' => ['create', 'update'], 'allowEmpty' => false]);
$validator->requirePresence('password_confirm', 'create')->notEmpty('password_confirm');
$validator->allowEmpty('website');
$validator->allowEmpty('bio');
$validator->requirePresence('role', 'create')->notEmpty('role', 'A valid role is required.')->add('role', 'inlist', ['rule' => ['inList', ['admin', 'author', 'user']], 'message' => 'Please enter a valid role']);
$validator->integer('status')->requirePresence('status', 'create')->notEmpty('status');
$validator->integer('file_count')->requirePresence('file_count', 'create')->notEmpty('file_count');
$validator->integer('note_count')->requirePresence('note_count', 'create')->notEmpty('note_count');
$validator->integer('post_count')->requirePresence('post_count', 'create')->notEmpty('post_count');
$validator->integer('album_count')->requirePresence('album_count', 'create')->notEmpty('album_count');
$validator->integer('project_count')->requirePresence('project_count', 'create')->notEmpty('project_count');
$validator->requirePresence('preferences', 'create')->notEmpty('preferences');
return $validator;
}
示例10: validationDefault
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator->uuid('id')->allowEmpty('id', 'create');
return $validator;
}
示例11: validationDefault
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator->uuid('id')->allowEmpty('id', 'create');
$validator->requirePresence('name', 'create')->notEmpty('name')->add('name', 'unique', ['rule' => 'validateUnique', 'provider' => 'table', 'message' => __d('CsvMigrations', 'Name MUST be unique')]);
return $validator;
}