当前位置: 首页>>代码示例>>PHP>>正文


PHP BaseActiveRecordVersioned::afterValidate方法代码示例

本文整理汇总了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();
 }
开发者ID:code-4-england,项目名称:OpenEyes,代码行数:7,代码来源:Medication.php

示例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();
 }
开发者ID:openeyes,项目名称:openeyes,代码行数:7,代码来源:OphCiExamination_IntraocularPressure_Value.php

示例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();
 }
开发者ID:code-4-england,项目名称:OpenEyes,代码行数:10,代码来源:Measurement.php

示例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();
 }
开发者ID:openeyes,项目名称:openeyes,代码行数:21,代码来源:Queue.php

示例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);
     }
 }
开发者ID:openeyes,项目名称:openeyes,代码行数:10,代码来源:User.php

示例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();
 }
开发者ID:openeyes,项目名称:openeyes,代码行数:16,代码来源:WorklistPatient.php

示例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();
 }
开发者ID:openeyes,项目名称:openeyes,代码行数:9,代码来源:OphTrOperationbooking_Operation_Booking.php


注:本文中的BaseActiveRecordVersioned::afterValidate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。