Prado\Data\ActiveRecord\Relations\TActiveRecordHasOne::updateAssociatedRecords PHP Method

updateAssociatedRecords() public method

Updates the associated foreign objects.
public updateAssociatedRecords ( ) : boolean
return boolean true if all update are success (including if no update was required), false otherwise .
    public function updateAssociatedRecords()
    {
        $fkObject = $this->getContext()->getPropertyValue();
        $source = $this->getSourceRecord();
        $fkeys = $this->findForeignKeys($fkObject, $source);
        foreach ($fkeys as $fKey => $srcKey) {
            $fkObject->setColumnValue($fKey, $source->getColumnValue($srcKey));
        }
        return $fkObject->save();
    }