/** * Helper method for saving an association's data. * * @param Association $association The association object to save with. * @param Entity $entity The entity to save * @param array $nested Options for deeper associations * @param array $options Original options * @return bool Success */ protected function _save($association, $entity, $nested, $options) { if (!$entity->dirty($association->property())) { return true; } if (!empty($nested)) { $options = (array) $nested + $options; } return (bool) $association->save($entity, $options); }