src/Entity/FlowStep.php line 24
<?phpnamespace App\Entity;use ApiPlatform\Metadata\ApiResource;use ApiPlatform\Metadata\Get;use ApiPlatform\Metadata\GetCollection;use App\Repository\FlowStepRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Serializer\Annotation\Groups;#[ORM\Entity(repositoryClass: FlowStepRepository::class)]#[ApiResource(operations: [new GetCollection(),new Get(normalizationContext: ['groups' => ['flow:list', 'flow:view']]),],normalizationContext: ['groups' => ['flow:list']])]class FlowStep{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]#[Groups(['flow:list'])]private ?int $id = null;#[ORM\Column(length: 255)]#[Groups(['flow:list'])]private ?string $name = null;#[ORM\Column(nullable: true)]private array $users = [];#[ORM\OneToMany(mappedBy: 'step', targetEntity: FlowAction::class)]#[Groups(['flow:list'])]private Collection $flowActions;#[ORM\OneToMany(mappedBy: 'step', targetEntity: Flow::class)]#[Groups(['flow:list'])]private Collection $flows;#[ORM\Column]#[Groups(['flow:list'])]private ?int $rank = null;#[ORM\ManyToOne(inversedBy: 'step')]#[ORM\JoinColumn(nullable: false)]#[Groups(['flow:list'])]private ?FlowProcess $flowProcess = null;public function __construct(){$this->flowActions = new ArrayCollection();$this->flows = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getName(): ?string{return $this->name;}public function setName(string $name): self{$this->name = $name;return $this;}public function getUsers(): array{return $this->users;}public function setUsers(?array $users): self{$this->users = $users;return $this;}/*** @return Collection<int, FlowAction>*/public function getFlowActions(): Collection{return $this->flowActions;}public function addFlowAction(FlowAction $flowAction): self{if (!$this->flowActions->contains($flowAction)) {$this->flowActions->add($flowAction);$flowAction->setStep($this);}return $this;}public function removeFlowAction(FlowAction $flowAction): self{if ($this->flowActions->removeElement($flowAction)) {// set the owning side to null (unless already changed)if ($flowAction->getStep() === $this) {$flowAction->setStep(null);}}return $this;}/*** @return Collection<int, Flow>*/public function getFlows(): Collection{return $this->flows;}public function addFlow(Flow $flow): self{if (!$this->flows->contains($flow)) {$this->flows->add($flow);$flow->setStep($this);}return $this;}public function removeFlow(Flow $flow): self{if ($this->flows->removeElement($flow)) {// set the owning side to null (unless already changed)if ($flow->getStep() === $this) {$flow->setStep(null);}}return $this;}public function getRank(): ?int{return $this->rank;}public function setRank(int $rank): self{$this->rank = $rank;return $this;}public function getFlowProcess(): ?FlowProcess{return $this->flowProcess;}public function setFlowProcess(?FlowProcess $flowProcess): self{$this->flowProcess = $flowProcess;return $this;}}