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;
}