src/Entity/RecipeStep.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\traits\base64Field;
  4. use App\Entity\traits\Timestapable;
  5. use App\Repository\RecipeStepRepository;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Component\Serializer\Annotation\Groups;
  9. #[ORM\Entity(repositoryClassRecipeStepRepository::class)]
  10. class RecipeStep
  11. {
  12.     use Timestapable;
  13.     use base64Field;
  14.     #[ORM\Id]
  15.     #[ORM\GeneratedValue]
  16.     #[ORM\Column]
  17.     #[Groups(["list_recipes""show_recipe"])]
  18.     private ?int $id null;
  19.     #[ORM\Column(length255)]
  20.     #[Groups(["list_recipes""show_recipe"])]
  21.     private ?string $name null;
  22.     #[ORM\Column(length255)]
  23.     #[Groups(["list_recipes""show_recipe"])]
  24.     private ?string $title null;
  25.     #[ORM\Column(length255nullabletrue)]
  26.     private ?string $image_url null;
  27.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  28.     #[Groups(["list_recipes""show_recipe"])]
  29.     private ?string $desription null;
  30.     #[ORM\Column]
  31.     private ?int $step_number null;
  32.     #[ORM\ManyToOne(inversedBy'recipeSteps'cascade:['persist''remove'])]
  33.     #[ORM\JoinColumn(name:"recipe_id"referencedColumnName:"id"onDelete:"CASCADE", )]
  34.     private ?Recipe $recipe null;
  35.     public function getId(): ?int
  36.     {
  37.         return $this->id;
  38.     }
  39.     public function getName(): ?string
  40.     {
  41.         return $this->name;
  42.     }
  43.     public function setName(string $name): self
  44.     {
  45.         $this->name $name;
  46.         return $this;
  47.     }
  48.     public function getImageUrl(): ?string
  49.     {
  50.         return $this->image_url;
  51.     }
  52.     public function setImageUrl(string $image_url): self
  53.     {
  54.         $this->image_url $image_url;
  55.         return $this;
  56.     }
  57.     public function getDesription(): ?string
  58.     {
  59.         return $this->desription;
  60.     }
  61.     public function setDesription(?string $desription): self
  62.     {
  63.         $this->desription $desription;
  64.         return $this;
  65.     }
  66.     public function getStepNumber(): ?string
  67.     {
  68.         return $this->step_number;
  69.     }
  70.     public function setStepNumber(string $step_number): self
  71.     {
  72.         $this->step_number $step_number;
  73.         return $this;
  74.     }
  75.     public function getRecipe($need false)
  76.     {
  77.         if ($need == true) {
  78.             return $this->recipe;
  79.         } else {
  80.             return null;
  81.         }
  82.     }
  83.     public function setRecipe(?Recipe $recipe): self
  84.     {
  85.         $this->recipe $recipe;
  86.         return $this;
  87.     }
  88.     public function getTitle()
  89.     {
  90.         return $this->title;
  91.     }
  92.     public function setTitle($title)
  93.     {
  94.         $this->title $title;
  95.         return $this;
  96.     }
  97. }