From 881a50f96d107728062259b3cc6c8ccdf7e2725a Mon Sep 17 00:00:00 2001 From: Djyp Date: Sun, 3 Mar 2019 00:19:09 +0100 Subject: [PATCH] Creating the Recipe entity WIP --- src/Entity/Recipe.php | 108 ++++++++++++++++++++++++++++ src/Repository/RecipeRepository.php | 50 +++++++++++++ 2 files changed, 158 insertions(+) create mode 100644 src/Entity/Recipe.php create mode 100644 src/Repository/RecipeRepository.php diff --git a/src/Entity/Recipe.php b/src/Entity/Recipe.php new file mode 100644 index 0000000..0a21200 --- /dev/null +++ b/src/Entity/Recipe.php @@ -0,0 +1,108 @@ +id; + } + + public function getCookTime(): ?string + { + return $this->cookTime; + } + + public function setCookTime(?string $cookTime): self + { + $this->cookTime = $cookTime; + + return $this; + } + + public function getCookingMethod(): ?string + { + return $this->cookingMethod; + } + + public function setCookingMethod(?string $cookingMethod): self + { + $this->cookingMethod = $cookingMethod; + + return $this; + } + + public function getRecipeCategory(): ?string + { + return $this->recipeCategory; + } + + public function setRecipeCategory(string $recipeCategory): self + { + $this->recipeCategory = $recipeCategory; + + return $this; + } + + public function getRecipeCuisine(): ?string + { + return $this->recipeCuisine; + } + + public function setRecipeCuisine(?string $recipeCuisine): self + { + $this->recipeCuisine = $recipeCuisine; + + return $this; + } + + public function getRecipeIngredient() + { + return $this->recipeIngredient; + } + + public function setRecipeIngredient($recipeIngredient): self + { + $this->recipeIngredient = $recipeIngredient; + + return $this; + } +} diff --git a/src/Repository/RecipeRepository.php b/src/Repository/RecipeRepository.php new file mode 100644 index 0000000..5c23dc0 --- /dev/null +++ b/src/Repository/RecipeRepository.php @@ -0,0 +1,50 @@ +createQueryBuilder('r') + ->andWhere('r.exampleField = :val') + ->setParameter('val', $value) + ->orderBy('r.id', 'ASC') + ->setMaxResults(10) + ->getQuery() + ->getResult() + ; + } + */ + + /* + public function findOneBySomeField($value): ?Recipe + { + return $this->createQueryBuilder('r') + ->andWhere('r.exampleField = :val') + ->setParameter('val', $value) + ->getQuery() + ->getOneOrNullResult() + ; + } + */ +}