本文整理汇总了PHP中BaseActiveRecordVersioned类的典型用法代码示例。如果您正苦于以下问题:PHP BaseActiveRecordVersioned类的具体用法?PHP BaseActiveRecordVersioned怎么用?PHP BaseActiveRecordVersioned使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BaseActiveRecordVersioned类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: delete
/**
* Extend parent behaviour to enforce a transaction so that we don't lose commissioning
* body assignments if the delete fails part way through.
*
* @return bool
*
* @throws Exception
*/
public function delete()
{
// perform this process in a transaction if one has not been created
$transaction = Yii::app()->db->getCurrentTransaction() === null ? Yii::app()->db->beginTransaction() : false;
try {
if (parent::delete()) {
if ($transaction) {
$transaction->commit();
}
return true;
} else {
if ($transaction) {
$transaction->rollback();
}
return false;
}
} catch (Exception $e) {
if ($transaction) {
$transaction->rollback();
}
throw $e;
}
}
开发者ID:openeyes,项目名称:openeyes,代码行数:31,代码来源:Practice.php
示例17: 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
示例18: beforeDelete
/**
* Dissociate the session from cancelled bookings and ERODs before deletion.
*/
protected function beforeDelete()
{
OphTrOperationbooking_Operation_Booking::model()->updateAll(array('session_id' => null), 'session_id = :session_id and booking_cancellation_date is not null', array(':session_id' => $this->id));
OphTrOperationbooking_Operation_EROD::model()->updateAll(array('session_id' => null), 'session_id = :session_id', array(':session_id' => $this->id));
return parent::beforeDelete();
}
开发者ID:openeyes,项目名称:openeyes,代码行数:9,代码来源:OphTrOperationbooking_Operation_Session.php
示例19: afterSave
protected function afterSave()
{
return parent::afterSave();
}
开发者ID:openeyes,项目名称:openeyes,代码行数:4,代码来源:OphInVisualfields_Condition_Ability.php
示例20: 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
注:本文中的BaseActiveRecordVersioned类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论