src/Entity/Flow.php line 25
<?phpnamespace App\Entity;use ApiPlatform\Metadata\ApiResource;use ApiPlatform\Metadata\Get;use ApiPlatform\Metadata\GetCollection;use App\Repository\FlowRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Serializer\Annotation\Groups;#[ApiResource(operations: [new GetCollection(),new Get(normalizationContext: ['groups' => ['flow:list', 'flow:view']]),],normalizationContext: ['groups' => ['flow:list']])]#[ORM\Entity(repositoryClass: FlowRepository::class)]class Flow{#[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(type: Types::TEXT, nullable: true)]#[Groups(['flow:list'])]private ?string $content = null;#[ORM\OneToMany(mappedBy: 'flow', targetEntity: Attachment::class)]private Collection $attachments;#[ORM\OneToMany(mappedBy: 'flow', targetEntity: FlowUser::class)]#[Groups(['flow:list'])]private Collection $flowUsers;#[ORM\ManyToOne(inversedBy: 'flows')]#[Groups(['flow:list'])]private ?FlowStep $step = null;#[ORM\Column]#[Groups(['flow:list'])]private ?int $rank = null;public function __construct(){$this->attachments = new ArrayCollection();$this->flowUsers = 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 getContent(): ?string{return $this->content;}public function setContent(?string $content): self{$this->content = $content;return $this;}/*** @return Collection<int, Attachment>*/public function getAttachments(): Collection{return $this->attachments;}public function addAttachment(Attachment $attachment): self{if (!$this->attachments->contains($attachment)) {$this->attachments->add($attachment);$attachment->setFlow($this);}return $this;}public function removeAttachment(Attachment $attachment): self{if ($this->attachments->removeElement($attachment)) {// set the owning side to null (unless already changed)if ($attachment->getFlow() === $this) {$attachment->setFlow(null);}}return $this;}/*** @return Collection<int, FlowUser>*/public function getFlowUsers(): Collection{return $this->flowUsers;}public function addFlowUser(FlowUser $flowUser): self{if (!$this->flowUsers->contains($flowUser)) {$this->flowUsers->add($flowUser);$flowUser->setFlow($this);}return $this;}public function removeFlowUser(FlowUser $flowUser): self{if ($this->flowUsers->removeElement($flowUser)) {// set the owning side to null (unless already changed)if ($flowUser->getFlow() === $this) {$flowUser->setFlow(null);}}return $this;}public function getStep(): ?FlowStep{return $this->step;}public function setStep(?FlowStep $step): self{$this->step = $step;return $this;}public function getRank(): ?int{return $this->rank;}public function setRank(int $rank): self{$this->rank = $rank;return $this;}}