本文整理汇总了PHP中BaseActiveRecordVersioned::afterValidate方法的典型用法代码示例。如果您正苦于以下问题:PHP BaseActiveRecordVersioned::afterValidate方法的具体用法?PHP BaseActiveRecordVersioned::afterValidate怎么用?PHP BaseActiveRecordVersioned::afterValidate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseActiveRecordVersioned
的用法示例。
在下文中一共展示了BaseActiveRecordVersioned::afterValidate方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: afterValidate
public function afterValidate()
{
if ($this->drug_id && $this->medication_drug_id) {
$this->addError('drug_id', "Cannot have two different drug types in the same medication record");
}
return parent::afterValidate();
}
示例2: afterValidate
public function afterValidate()
{
if (!$this->reading_id && !$this->qualitative_reading_id) {
$this->addError('reading_id', 'Either a numerical reading or a qualitative reading must be specified.');
}
return parent::afterValidate();
}
示例3: afterValidate
protected function afterValidate()
{
$this->getPatientMeasurement()->validate();
foreach ($this->getPatientMeasurement()->getErrors() as $attribute => $errors) {
foreach ($errors as $error) {
$this->addError($attribute, $error);
}
}
parent::afterValidate();
}
示例4: afterValidate
/**
* assignment field validation.
*/
public function afterValidate()
{
// validate any widget fields in the assignment_fields attribute
foreach ($this->getAssignmentFieldDefinitions() as $i => $fld) {
if (!($id = @$fld['id'])) {
$this->addError('assignment_fields', 'ID required for assignment field ' . ($i + 1));
continue;
}
if (@$fld['type'] == 'widget') {
if (!@$fld['widget_name']) {
$this->addError('assignment_fields', 'Widget Name missing for ' . $id);
} elseif (!is_file(\Yii::getPathOfAlias('application.modules.PatientTicketing.widgets.' . $fld['widget_name']) . '.php')) {
$this->addError('assignment_fields', 'Widget with name ' . $fld['widget_name'] . ' for ' . $id . ' not defined');
}
}
}
parent::afterValidate();
}
示例5: afterValidate
/**
* Hashes the user password for insertion into the db.
*/
protected function afterValidate()
{
parent::afterValidate();
if (!preg_match('/^[0-9a-f]{32}$/', $this->password)) {
$this->password = $this->hashPassword($this->password, $this->salt);
}
}
示例6: afterValidate
/**
* Only set when for scheduled worklist entries.
*/
public function afterValidate()
{
if ($this->worklist->scheduled) {
if (empty($this->when)) {
$this->addError('when', $this->getAttributeLabel('when') . ' is required when the Worklist is scheduled.');
}
} else {
if (!empty($this->when)) {
$this->addError('when', $this->getAttributeLabel('when') . ' cannot be set when the Worklist not scheduled.');
}
}
parent::afterValidate();
}
示例7: afterValidate
protected function afterValidate()
{
if (preg_match('/^([0-9]{1,2}).*?([0-9]{2})$/', $this->admission_time, $m)) {
if ((int) $m[1] > 23 || (int) $m[2] > 59) {
$this->addError('admission_time', 'Please enter a valid admission time in the 24-hour clock format');
}
}
return parent::afterValidate();
}