本文整理匯總了PHP中Cake\ORM\RulesChecker::existsIn方法的典型用法代碼示例。如果您正苦於以下問題:PHP RulesChecker::existsIn方法的具體用法?PHP RulesChecker::existsIn怎麽用?PHP RulesChecker::existsIn使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Cake\ORM\RulesChecker
的用法示例。
在下文中一共展示了RulesChecker::existsIn方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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->existsIn(['student_id'], 'Students'));
$rules->add($rules->existsIn(['study_group_id'], 'StudyGroups'));
$rules->add($rules->existsIn(['level_id'], 'Levels'));
return $rules;
}
示例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(['email']));
$rules->add($rules->existsIn(['user_id'], 'Users'));
$rules->add($rules->existsIn(['country_id'], 'Countries'));
return $rules;
}
示例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->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;
}
示例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->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;
}
示例5: buildRules
public function buildRules(RulesChecker $rules)
{
$rules->add($rules->isUnique(['email']));
$rules->add($rules->existsIn(['user_id'], 'Users'));
$rules->add($rules->existsIn(['client_info_id'], 'ClientInfos'));
return $rules;
}