本文整理汇总了PHP中ORM::rules方法的典型用法代码示例。如果您正苦于以下问题:PHP ORM::rules方法的具体用法?PHP ORM::rules怎么用?PHP ORM::rules使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ORM
的用法示例。
在下文中一共展示了ORM::rules方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: rules
public function rules()
{
$rules = parent::rules();
$rules['prefix'] = array(array('not_empty'), array('min_length', array(':value', 0)), array('max_length', array(':value', 5)), array(array($this, 'notReserved')), array(array($this, 'uniquePrefix')));
$rules['location'] = array(array('not_empty'), array('min_length', array(':value', 0)), array('max_length', array(':value', 255)));
return $rules;
}
示例2: rules
public function rules()
{
$rules = parent::rules();
$rules['email'] = array(array('not_empty'), array('email'), array(array($this, '_valid_unique'), array('email', ':value')));
$rules['gname'] = array(array('not_empty'));
$rules['sname'] = array(array('not_empty'));
$rules['phone'] = array(array('phone'), array(array($this, '_valid_unique'), array('phone', ':value')));
$rules['password'] = array(array('not_empty'), array('min_length', array(':value', 6)), array('max_length', array(':value', 255)));
$rules['status'] = array(array(array($this, '_valid_status_code')));
return $rules;
}
示例3: rules
public function rules()
{
$rules = parent::rules();
$rules['phone'] = array(array('phone'));
$rules['agree_toc'] = array(array('range', array(':value', 0, 1)));
//This field is not triggered?
$rules['pass_id'] = array(array(array($this, '__valid_pass')));
$rules['reg_id'] = array(array('not_empty'), array(array($this, '__check_regID_availability')));
$rules['email'] = array(array('email'));
$rules['dob'] = array(array('date'));
foreach ($this->formo_defaults as $field => $fieldData) {
if (!isset($rules[$field])) {
$rules[$field] = array();
}
if (isset($fieldData['required']) && $fieldData['required']) {
array_push($rules[$field], array('not_empty'));
} else {
array_push($rules[$field], array('min_length', array(':value', 0)));
}
array_push($rules[$field], array('max_length', array(':value', 255)));
}
return $rules;
}
示例4: rules
/**
* Rules for the user model
*
* @return array Rules
*/
public function rules()
{
return array_merge(parent::rules(), array());
}