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


PHP BaseActiveRecordVersioned::beforeSave方法代碼示例

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


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

示例1: beforeSave

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

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

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

示例4: beforeSave

 protected function beforeSave()
 {
     if ($this->is_automated && !is_string($this->automated_source)) {
         $this->automated_source = json_encode($this->automated_source);
     }
     return parent::beforeSave();
 }
開發者ID:openeyes,項目名稱:openeyes,代碼行數:7,代碼來源:Event.php

示例5: beforeSave

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

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

示例7: beforeSave

 public function beforeSave()
 {
     foreach (array('first_name', 'last_name', 'dob', 'title', 'primary_phone') as $property) {
         if ($randomised = $this->randomData($property)) {
             $this->{$property} = $randomised;
         }
     }
     return parent::beforeSave();
 }
開發者ID:openeyeswales,項目名稱:OpenEyes,代碼行數:9,代碼來源:Patient.php

示例8: beforeSave

 public function beforeSave()
 {
     switch ($this->type) {
         case 'site':
             $this->firm_id = null;
             $this->subspecialty = null;
             break;
         case 'subspecialty':
             $this->firm_id = null;
             $this->site_id = null;
             break;
         case 'firm':
             $this->subspecialty_id = null;
             $this->site_id = null;
             break;
     }
     return parent::beforeSave();
 }
開發者ID:openeyes,項目名稱:openeyes,代碼行數:18,代碼來源:LetterMacro.php

示例9: beforeSave

 public function beforeSave()
 {
     if (parent::beforeSave()) {
         if ($this->isNewRecord && !$this->address_type_id) {
             // make correspondence the default address type
             $this->address_type_id = AddressType::CORRESPOND;
         }
         return true;
     }
     return false;
 }
開發者ID:code-4-england,項目名稱:OpenEyes,代碼行數:11,代碼來源:Address.php

示例10: beforeSave

 public function beforeSave()
 {
     $this->primary_gender = $this->primary_gender;
     return parent::beforeSave();
 }
開發者ID:openeyes,項目名稱:openeyes,代碼行數:5,代碼來源:PatientMergeRequest.php

示例11: beforeSave

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


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