src/Entity/Details/Operation/DetailsStep.php line 39

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Details\Operation;
  3. use ApiPlatform\Core\Annotation\ApiResource;
  4. use App\Entity\Ean\Ean;
  5. use App\Repository\Details\DetailsStepRepository;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use Doctrine\Common\Collections\Collection;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Symfony\Component\Serializer\Annotation\Groups;
  10. use Symfony\Component\Serializer\Annotation\SerializedName;
  11. use App\Entity\Operation\Step;
  12. /**
  13.  * @ApiResource(
  14.  *     attributes={
  15.  *          "force_eager"=false,
  16.  *          "normalization_context"={
  17.  *              "groups"={
  18.  *                  "DetailsStep:output",
  19.  *                  "DetailsStep:io"
  20.  *               },
  21.  *              "enable_max_depth"=true
  22.  *          },
  23.  *          "denormalization_context"={
  24.  *              "groups"={
  25.  *                  "DetailsStep:output",
  26.  *                  "DetailsStep:io"
  27.  *               },
  28.  *              "enable_max_depth"=true
  29.  *          }
  30.  *      },
  31.  *     collectionOperations={"GET"},
  32.  *     itemOperations={"GET"},
  33.  * )
  34.  * @ORM\Entity(repositoryClass=DetailsStepRepository::class)
  35.  */
  36. class DetailsStep extends DetailsOperation
  37. {
  38.     /**
  39.      * @ORM\OneToOne(targetEntity=Step::class, inversedBy="details")
  40.      * @ORM\JoinColumn(name="object_id", referencedColumnName="id")
  41.      * @Groups({
  42.      *     "DetailsStep:io",
  43.      *     "OperationStep:io",
  44.      *     "get_all_public_steps",
  45.      * })
  46.      */
  47.     private $operation;
  48.     /**
  49.      * @return string
  50.      */
  51.     public function getId() : string
  52.     {
  53.         return $this->id;
  54.     }
  55.     public function getStep(): Step
  56.     {
  57.         return $this->operation;
  58.     }
  59.     public function setStep(Step $step): self
  60.     {
  61.         $this->operation $step;
  62.         return $this;
  63.     }
  64.     public function getOperation(): Step
  65.     {
  66.         return $this->operation;
  67.     }
  68.     public function setOperation(Step $step): self
  69.     {
  70.         $this->operation $step;
  71.         return $this;
  72.     }
  73. }