當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。