当前位置: 首页>>代码示例>>PHP>>正文


PHP Validator::uuid方法代码示例

本文整理汇总了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;
 }
开发者ID:QoboLtd,项目名称:cakephp-menu,代码行数:13,代码来源:MenusTable.php

示例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;
 }
开发者ID:QoboLtd,项目名称:cakephp-menu,代码行数:14,代码来源:MenuItemsTable.php

示例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;
 }
开发者ID:el-cms,项目名称:elabs,代码行数:14,代码来源:NotesTable.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('model', 'create')->notEmpty('model');
     $validator->uuid('fkid')->requirePresence('fkid', 'create')->notEmpty('fkid');
     $validator->requirePresence('type', 'create')->notEmpty('type');
     return $validator;
 }
开发者ID:el-cms,项目名称:elabs,代码行数:14,代码来源:ActsTable.php

示例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;
 }
开发者ID:el-cms,项目名称:elabs,代码行数:17,代码来源:PostsTable.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->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;
 }
开发者ID:el-cms,项目名称:elabs,代码行数:17,代码来源:CommentsTable.php

示例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;
 }
开发者ID:el-cms,项目名称:elabs,代码行数:17,代码来源:ProjectsTable.php

示例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;
 }
开发者ID:scherersoftware,项目名称:cakephp-app-template,代码行数:22,代码来源:UsersTable.php

示例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;
 }
开发者ID:el-cms,项目名称:elabs,代码行数:28,代码来源:UsersTable.php

示例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;
 }
开发者ID:wolfgang-braun,项目名称:cake-relay,代码行数:11,代码来源:CwsConnectionsTable.php

示例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;
 }
开发者ID:QoboLtd,项目名称:cakephp-csv-migrations,代码行数:12,代码来源:DblistsTable.php


注:本文中的Cake\Validation\Validator::uuid方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。