当前位置: 首页>>代码示例>>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;未经允许,请勿转载。