When using the 'append' strategy, this function will only create new links
between each side of this association. It will not destroy existing ones even
though they may not be present in the array of entities to be saved.
When using the 'replace' strategy, existing links will be removed and new links
will be created in the joint table. If there exists links in the database to some
of the entities intended to be saved by this method, they will be updated,
not deleted.
public saveAssociated ( Cake\Datasource\EntityInterface $entity, array $options = [] ) : boolean | Cake\Datasource\EntityInterface | ||
$entity | Cake\Datasource\EntityInterface | an entity from the source table |
$options | array | options to be passed to the save method in the target table |
return | boolean | Cake\Datasource\EntityInterface | false if $entity could not be saved, otherwise it returns the saved entity |