當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。