public function saveHasRelations(EntityInterface $entity, array $options = [])
{
if ($entity->isNew()) {
throw new \InvalidArgumentException("The provided entity is new. The entity must be persisted before saving relations.");
}
$relations = $entity->relations($this, $entity);
$lastResult = false;
foreach ($relations as $relationName => $relation) {
if (!$relation instanceof Relation\BelongsTo) {
$lastResult = $relation->save($entity, $relationName, $options);
}
}
return $lastResult;
}