public function save(AnnouncementPrice $announcementPrice) { if ($announcementPrice->isValid()) { $announcementPrice->isNew() ? $this->add($announcementPrice) : $this->modify($announcementPrice); } else { throw new RuntimeException('Les prix pour l\'annonce doivent être valide pour être enregistrée'); } }