Prado\Data\ActiveRecord\Relations\TActiveRecordHasManyAssociation::updateAssociatedRecords PHP Метод

updateAssociatedRecords() публичный Метод

Updates the associated foreign objects.
public updateAssociatedRecords ( ) : boolean
Результат boolean true if all update are success (including if no update was required), false otherwise .
    public function updateAssociatedRecords()
    {
        $obj = $this->getContext()->getSourceRecord();
        $fkObjects =& $obj->{$this->getContext()->getProperty()};
        $success = true;
        if (($total = count($fkObjects)) > 0) {
            $source = $this->getSourceRecord();
            $builder = $this->getAssociationTableCommandBuilder();
            for ($i = 0; $i < $total; $i++) {
                $success = $fkObjects[$i]->save() && $success;
            }
            return $this->updateAssociationTable($obj, $fkObjects, $builder) && $success;
        }
        return $success;
    }