當前位置: 首頁>>代碼示例>>PHP>>正文


PHP RulesChecker::isUnique方法代碼示例

本文整理匯總了PHP中Cake\ORM\RulesChecker::isUnique方法的典型用法代碼示例。如果您正苦於以下問題:PHP RulesChecker::isUnique方法的具體用法?PHP RulesChecker::isUnique怎麽用?PHP RulesChecker::isUnique使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Cake\ORM\RulesChecker的用法示例。


在下文中一共展示了RulesChecker::isUnique方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: buildRules

 /**
  * Returns a rules checker object that will be used for validating
  * application integrity.
  *
  * @param \Cake\ORM\RulesChecker $rules The rules object to be modified.
  * @return \Cake\ORM\RulesChecker
  */
 public function buildRules(RulesChecker $rules)
 {
     $rules->add($rules->isUnique(['username']));
     $rules->add($rules->isUnique(['email']));
     $rules->add($rules->existsIn(['department_id'], 'Departments'));
     $rules->add($rules->existsIn(['user_id'], 'Users'));
     return $rules;
 }
開發者ID:posdawpmv,項目名稱:sad360,代碼行數:15,代碼來源:UsersTable.php

示例2: buildRules

 /**
  * Returns a rules checker object that will be used for validating
  * application integrity.
  *
  * @param \Cake\ORM\RulesChecker $rules The rules object to be modified.
  * @return \Cake\ORM\RulesChecker
  */
 public function buildRules(RulesChecker $rules)
 {
     $rules->add($rules->isUnique(['username']));
     //Same email should be allowed in contact form
     //$rules->add($rules->isUnique(['email']));
     return $rules;
 }
開發者ID:esaul314,項目名稱:norn-cms,代碼行數:14,代碼來源:UsersTable.php

示例3: buildRules

 /**
  * Returns a rules checker object that will be used for validating
  * application integrity.
  *
  * @param \Cake\ORM\RulesChecker $rules The rules object to be modified.
  * @return \Cake\ORM\RulesChecker
  */
 public function buildRules(RulesChecker $rules)
 {
     $rules->add($rules->isUnique(['email']));
     $rules->add($rules->isUnique(['username']));
     //   $rules->add($rules->existsIn(['facebook_id'], 'Facebooks'));
     return $rules;
 }
開發者ID:webroup17,項目名稱:social_networking,代碼行數:14,代碼來源:UsersTable.php

示例4: buildRules

 /**
  * Returns a rules checker object that will be used for validating
  * application integrity.
  *
  * @param \Cake\ORM\RulesChecker $rules The rules object to be modified.
  * @return \Cake\ORM\RulesChecker
  */
 public function buildRules(RulesChecker $rules)
 {
     $rules->add($rules->isUnique(['username']));
     $rules->add($rules->isUnique(['email']));
     $rules->add($rules->isUnique(['matricula']));
     return $rules;
 }
開發者ID:daniels85,項目名稱:SGL,代碼行數:14,代碼來源:UsersTable.php

示例5: buildRules

 /**
  * Returns a rules checker object that will be used for validating
  * application integrity.
  *
  * @param \Cake\ORM\RulesChecker $rules The rules object to be modified.
  * @return \Cake\ORM\RulesChecker
  */
 public function buildRules(RulesChecker $rules)
 {
     $rules->add($rules->isUnique(['username']));
     $rules->add($rules->isUnique(['email']));
     $rules->add($rules->existsIn(['role_id'], 'Roles'));
     return $rules;
 }
開發者ID:alaxos,項目名稱:alaskyzer,代碼行數:14,代碼來源:UsersTable.php

示例6: buildRules

 /**
  * Returns a rules checker object that will be used for validating
  *  application integrity
  * @param \Cake\ORM\RulesChecker $rules The rules object to be modified
  * @return \Cake\ORM\RulesChecker
  */
 public function buildRules(RulesChecker $rules)
 {
     $rules->add($rules->isUnique(['title']));
     $rules->add($rules->isUnique(['slug']));
     $rules->add($rules->existsIn(['parent_id'], 'Parents'));
     return $rules;
 }
開發者ID:mirko-pagliai,項目名稱:me-cms,代碼行數:13,代碼來源:PagesCategoriesTable.php

示例7: buildRules

 /**
  * Returns a rules checker object that will be used for validating
  * application integrity.
  *
  * @param \Cake\ORM\RulesChecker $rules The rules object to be modified.
  * @return \Cake\ORM\RulesChecker
  */
 public function buildRules(RulesChecker $rules)
 {
     $rules->add($rules->isUnique(['username'], 'Tài khoản đã được đăng ký'));
     $rules->add($rules->isUnique(['email'], 'Email đã được đăng ký'));
     $rules->add($rules->existsIn(['role_id'], 'Roles', 'Role không hợp lệ'));
     return $rules;
 }
開發者ID:ansidev,項目名稱:cakephp_blog,代碼行數:14,代碼來源:UsersTable.php

示例8: buildRules

 /**
  * Returns a rules checker object that will be used for validating
  * application integrity.
  *
  * @param \Cake\ORM\RulesChecker $rules The rules object to be modified.
  * @return \Cake\ORM\RulesChecker
  */
 public function buildRules(RulesChecker $rules)
 {
     // Patikriname ar įvestas elektroninio pašto adersas nesikartoja duomenų bazėje.
     $rules->add($rules->isUnique(['email'], "Company email address already exist in our database."));
     $rules->add($rules->isUnique(['name'], "Company name already exist in our database."));
     return $rules;
 }
開發者ID:harolato,項目名稱:aviasolutions,代碼行數:14,代碼來源:CompaniesTable.php

示例9: buildRules

 /**
  * Application rules.
  *
  * @param \Cake\ORM\RulesChecker $rules The rule checker
  * @return \Cake\ORM\RulesChecker
  */
 public function buildRules(RulesChecker $rules)
 {
     // unique mail
     $rules->add($rules->isUnique(['email'], __d('user', 'e-mail already in use.')));
     // unique username
     $rules->add($rules->isUnique(['username'], __d('user', 'Username already in use.')));
     return $rules;
 }
開發者ID:quickapps-plugins,項目名稱:user,代碼行數:14,代碼來源:UsersTable.php

示例10: buildRules

 public function buildRules(RulesChecker $rules)
 {
     $rules->add($rules->isUnique(['username']));
     $rules->add($rules->isUnique(['email']));
     $rules->add($rules->existsIn(['user_type_id'], 'UserTypes'));
     $rules->add($rules->existsIn(['client_contact_id'], 'ClientContacts'));
     $rules->add($rules->existsIn(['client_info_id'], 'ClientInfos'));
     return $rules;
 }
開發者ID:julkar9,項目名稱:ntrack,代碼行數:9,代碼來源:UsersTable.php

示例11: buildRules

 /**
  * Returns a rules checker object that will be used for validating
  * application integrity.
  *
  * @param \Cake\ORM\RulesChecker $rules The rules object to be modified.
  * @return \Cake\ORM\RulesChecker
  */
 public function buildRules(RulesChecker $rules)
 {
     $rules->add($rules->existsIn(['student_id'], 'Students'));
     $rules->add($rules->existsIn(['test_id'], 'Tests'));
     $rules->add($rules->isUnique(['student_id', 'test_id'], 'Cet étudiant a déja participé à cet examen'));
     return $rules;
 }
開發者ID:AFPA-Dijon,項目名稱:afpa,代碼行數:14,代碼來源:StudentsTestsTable.php

示例12: buildRules

 /**
  * Returns a rules checker object that will be used for validating
  * application integrity.
  *
  * @param \Cake\ORM\RulesChecker $rules The rules object to be modified.
  * @return \Cake\ORM\RulesChecker
  */
 public function buildRules(RulesChecker $rules)
 {
     $rules->add($rules->existsIn(['group_id'], 'Groups'));
     $rules->add($rules->existsIn(['user_id'], 'Users'));
     $rules->add($rules->isUnique(['group_id', 'user_id']), ['errorField' => 'User', 'message' => 'User is already part of the group!!']);
     return $rules;
 }
開發者ID:Nandox7,項目名稱:StudentCentral,代碼行數:14,代碼來源:GroupUsersTable.php

示例13: buildRules

 /**
  * Returns a rules checker object that will be used for validating
  * application integrity.
  *
  * @param \Cake\ORM\RulesChecker $rules The rules object to be modified.
  * @return \Cake\ORM\RulesChecker
  */
 public function buildRules(RulesChecker $rules)
 {
     $rules->add($rules->existsIn(['node_code_id'], 'Nodes'));
     $rules->add($rules->existsIn(['data_type_id'], 'DataTypes'));
     $rules->add($rules->isUnique(['node_code_id', 'data_type_id']));
     return $rules;
 }
開發者ID:Krelyx,項目名稱:hub,代碼行數:14,代碼來源:SensorsTable.php

示例14: buildRules

 /**
  * Returns a rules checker object that will be used for validating
  * application integrity.
  *
  * @param \Cake\ORM\RulesChecker $rules The rules object to be modified.
  * @return \Cake\ORM\RulesChecker
  */
 public function buildRules(RulesChecker $rules)
 {
     $rules->add($rules->isUnique(['email']));
     $rules->add($rules->existsIn(['entreprises_id'], 'Entreprises'));
     $rules->add($rules->existsIn(['profil_id'], 'Profils'));
     return $rules;
 }
開發者ID:Nadia78,項目名稱:easyhr,代碼行數:14,代碼來源:UsersTable.php

示例15: buildRules

 public function buildRules(RulesChecker $rules)
 {
     $rules->add($rules->existsIn(['weeklyreport_id'], 'Weeklyreports'));
     $rules->add($rules->existsIn(['member_id'], 'Members'));
     $rules->add($rules->isUnique(['member_id', 'weeklyreport_id']));
     return $rules;
 }
開發者ID:Jukkaaf,項目名稱:Metrics-Project,代碼行數:7,代碼來源:WeeklyhoursTable.php


注:本文中的Cake\ORM\RulesChecker::isUnique方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。