FOF30\Model\DataModel\RelationManager::save PHP Метод

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

Saves all related items belonging to the specified relation or, if $name is null, all known relations which support saving.
public save ( null | string $name = null ) : DataModel
$name null | string The relation to save, or null to save all known relations
Результат FOF30\Model\DataModel The parent model, for chaining
    public function save($name = null)
    {
        if (is_null($name)) {
            foreach ($this->relations as $name => $relation) {
                try {
                    $relation->saveAll();
                } catch (DataModel\Relation\Exception\SaveNotSupported $e) {
                    // We don't care if a relation doesn't support saving
                }
            }
        } else {
            if (!isset($this->relations[$name])) {
                throw new DataModel\Relation\Exception\RelationNotFound("Relation '{$name}' not found");
            }
            $this->relations[$name]->saveAll();
        }
        return $this->parentModel;
    }