/** * Helper method for saving an association's data. * * @param \Cake\ORM\Association $association The association object to save with. * @param \Cake\ORM\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->saveAssociated($entity, $options); }