An instance of TActiveRecordHasOne, TActiveRecordBelongsTo, TActiveRecordHasMany,
or TActiveRecordHasManyAssocation will be returned.
public getRelationHandler ( $criteria = null ) : |
||
return | record relationship handler instnace. |
/** * @return TActiveRecordRelationCommand */ public function updateAssociatedRecords($updateBelongsTo = false) { $success = true; foreach ($this->_record->getRecordRelations() as $data) { list($property, $relation) = $data; $belongsTo = $relation[0] == TActiveRecord::BELONGS_TO; if ($updateBelongsTo && $belongsTo || !$updateBelongsTo && !$belongsTo) { $obj = $this->getSourceRecord(); if (!$this->isEmptyFkObject($obj->getColumnValue($property))) { $context = new TActiveRecordRelationContext($this->getSourceRecord(), $property, $relation); $success = $context->getRelationHandler()->updateAssociatedRecords() && $success; } } } return $success; }