Beispiel #1
0
 /**
  * @param Recipe $recipe
  * @return array
  * @throws RuntimeException
  */
 public function toArray(Recipe $recipe)
 {
     return ['name' => (string) $recipe->getName(), 'publicationDate' => $recipe->isPublished() ? $recipe->getPublicationDate()->format('Y-m-d H:i:s') : null, 'steps' => $this->serializeSteps($recipe), 'glass' => $recipe->isGlassRequired() ? (string) $recipe->getGlass()->getName() : null, 'description' => ['text' => $recipe->getDescription()->getText(), 'IBAOfficial' => $recipe->getDescription()->isOfficialIBA(), 'alcoholContent' => $recipe->getDescription()->getAlcoholContent(), 'taste' => $this->serializeTaste($recipe->getDescription()->getTaste())]];
 }