Esempio n. 1
0
 public function add(Crew $crew)
 {
     $crew->slugifyTitle();
     if (!$this->alreadyExists($crew)) {
         if ($crew->getId() == NULL) {
             $this->pflush($crew);
             return $crew;
         } else {
             throw new HttpException(400, "Entity ID must be NULL.");
         }
     } else {
         throw new HttpException(409, "Entity already exists.");
     }
 }