當前位置: 首頁>>代碼示例>>PHP>>正文


PHP BaseActiveRecordVersioned類代碼示例

本文整理匯總了PHP中BaseActiveRecordVersioned的典型用法代碼示例。如果您正苦於以下問題:PHP BaseActiveRecordVersioned類的具體用法?PHP BaseActiveRecordVersioned怎麽用?PHP BaseActiveRecordVersioned使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了BaseActiveRecordVersioned類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: 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

示例2: beforeSave

 public function beforeSave()
 {
     if (!$this->end_date) {
         $this->stop_reason_id = null;
     }
     return parent::beforeSave();
 }
開發者ID:openeyeswales,項目名稱:OpenEyes,代碼行數:7,代碼來源:Medication.php

示例3: beforeValidate

 protected function beforeValidate()
 {
     if (!$this->isAllowed()) {
         $this->addError('recipient_email', 'Recipient email is not in the list of allowed domains');
     }
     return parent::beforeValidate();
 }
開發者ID:openeyes,項目名稱:openeyes,代碼行數:7,代碼來源:OphCoTherapyapplication_Email_Recipient.php

示例4: beforeSave

 protected function beforeSave()
 {
     if (!parent::beforeSave() || !$this->getPatientMeasurement()->save()) {
         return false;
     }
     $this->patient_measurement_id = $this->getPatientMeasurement()->id;
     return true;
 }
開發者ID:code-4-england,項目名稱:OpenEyes,代碼行數:8,代碼來源:Measurement.php

示例5: beforeSave

 protected function beforeSave()
 {
     foreach ($this->findAll('patient_measurement_id = ?', array($this->patient_measurement_id)) as $existing) {
         if ($this->episode_id && $this->episode_id == $existing->episode_id) {
             throw new Exception("Measurement reference already exists from episode {$this->episode_id} to patient measurement {$this->patient_measurement_id}");
         }
         if ($this->event_id && $this->event_id == $existing->event_id) {
             throw new Exception("Measurement reference already exists from event {$this->event_id} to patient measurement {$this->patient_measurement_id}");
         }
         if ($this->origin && $existing->origin) {
             throw new Exception("Origin reference already exists for patient measurement {$this->patient_measurement_id}");
         }
     }
     return parent::beforeSave();
 }
開發者ID:openeyeswales,項目名稱:OpenEyes,代碼行數:15,代碼來源:MeasurementReference.php

示例6: afterConstruct

 /**
  * set a default display order for a new record.
  */
 protected function afterConstruct()
 {
     parent::afterConstruct();
     if (!$this->display_order) {
         $criteria = new CDbCriteria();
         $criteria->order = 'display_order desc';
         $criteria->limit = 1;
         $model = get_class($this);
         $bottom = $model::model()->find($criteria);
         if ($bottom) {
             $this->display_order = $bottom->display_order + 1;
         } else {
             $this->display_order = 1;
         }
     }
 }
開發者ID:openeyes,項目名稱:openeyes,代碼行數:19,代碼來源:OphTrOperationbooking_Operation_Session_UnavailableReason.php

示例7: afterDelete

 /**
  * ensures file is removed from filesystem when deleting
  *
  */
 public function afterDelete()
 {
     unlink($this->_stored_path);
     return parent::afterDelete();
 }
開發者ID:code-4-england,項目名稱:OpenEyes,代碼行數:9,代碼來源:ProtectedFile.php

示例8: __isset

 /**
  * @param string $prop
  * @return bool
  */
 public function __isset($prop)
 {
     $method = "get_" . $prop;
     if (method_exists($this, $method)) {
         return true;
     }
     return parent::__isset($prop);
 }
開發者ID:4Xerneas,項目名稱:OpenEyes,代碼行數:12,代碼來源:Procedure.php

示例9: delete

 public function delete()
 {
     if ($this->children) {
         foreach ($this->children as $child) {
             if (!$child->delete()) {
                 return false;
             }
         }
     }
     return parent::delete();
 }
開發者ID:openeyes,項目名稱:openeyes,代碼行數:11,代碼來源:BaseTree.php

示例10: beforeSave

 protected function beforeSave()
 {
     if ($this->start_date && !preg_match('/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/', $this->start_date)) {
         $this->start_date = date('Y-m-d', strtotime($this->start_date));
     }
     if ($this->end_date && !preg_match('/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/', $this->end_date)) {
         $this->end_date = date('Y-m-d', strtotime($this->end_date));
     }
     $this->default_admission_time = $this->setDefaultAdmissionTime($this->default_admission_time, $this->start_time);
     return parent::beforeSave();
 }
開發者ID:openeyes,項目名稱:openeyes,代碼行數:11,代碼來源:OphTrOperationbooking_Operation_Sequence.php

示例11: beforeValidate

 protected function beforeValidate()
 {
     return parent::beforeValidate();
 }
開發者ID:openeyes,項目名稱:openeyes,代碼行數:4,代碼來源:OphTrLaser_Type.php

示例12: beforeSave

 /**
  * @return bool
  */
 public function beforeSave()
 {
     if ($this->subspecialty_id) {
         $this->service_subspecialty_assignment_id = ServiceSubspecialtyAssignment::model()->find('subspecialty_id=?', array($this->subspecialty_id))->id;
     }
     return parent::beforeSave();
 }
開發者ID:code-4-england,項目名稱:OpenEyes,代碼行數:10,代碼來源:Firm.php

示例13: 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

示例14: instantiate

 /**
  * Override to allow us to have classes defined outside of core that store the data in a different way
  *
  * @param array $attributes
  * @return CActiveRecord
  */
 protected function instantiate($attributes)
 {
     if (isset($attributes['patient_measurement_id'])) {
         if ($pm = PatientMeasurement::model()->findByPk($attributes['patient_measurement_id'])) {
             $origin = $pm->originReference;
             if ($origin && $origin->event) {
                 $api = Yii::app()->moduleAPI->getForEventId($origin->event_id);
                 if ($api) {
                     OELog::log("we have an api");
                     return $api->getMeasurementClassForEventId($origin->event_id);
                 }
             }
         }
     }
     return parent::instantiate($attributes);
 }
開發者ID:openeyes,項目名稱:openeyes,代碼行數:22,代碼來源:Measurement.php

示例15: beforeValidate

 /**
  * check the time entry is valid.
  *
  * @return bool
  */
 public function beforeValidate()
 {
     if (!preg_match('/^(([01]?[0-9])|(2[0-3])):?[0-5][0-9]$/', $this->measurement_timestamp)) {
         $this->addError('measurement_timestamp', 'Invalid ' . $this->getAttributeLabel('measurement_timestamp'));
     }
     return parent::beforeValidate();
 }
開發者ID:openeyes,項目名稱:openeyes,代碼行數:12,代碼來源:OphCiPhasing_Reading.php


注:本文中的BaseActiveRecordVersioned類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。