src/Entity/Report.php line 28
<?phpdeclare(strict_types=1);namespace App\Entity;use ApiPlatform\Core\Annotation\ApiResource;use App\Entity\Mapped\Entity;use App\Repository\ReportRepository;use DateTime;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Serializer\Annotation\Groups;use Symfony\Component\Validator\Constraints as Assert;#[ORM\Entity(repositoryClass: ReportRepository::class)]#[ORM\Table(name: 'report')]#[ApiResource(collectionOperations: [],itemOperations: ['get'])]class Report extends Entity{#[ORM\Column(name: 'name',type: 'string',length: 181,nullable: true)]#[Assert\NotBlank(groups: ['action'])]#[Assert\Length(max: 180,groups: ['action'])]#[Groups(['read'])]private ?string $name = null;#[ORM\Column(name: 'date',type: 'datetime',nullable: true)]private ?DateTime $date = null;#[ORM\Column(name: 'submission_date',type: 'datetime',nullable: true)]private ?DateTime $submissionDate = null;#[ORM\Column(name: 'status',type: 'string',length: 181,nullable: true)]#[Assert\NotBlank(groups: ['action'])]#[Groups(['read'])]private ?string $status = null;#[ORM\ManyToOne(targetEntity: User::class)]#[ORM\JoinColumn(name: 'receiver')]private ?User $receiver = null;#[ORM\ManyToOne(targetEntity: Project::class,inversedBy: 'reports')]#[ORM\JoinColumn(name: 'project')]private ?Project $project = null;#[ORM\OneToMany(mappedBy: 'report',targetEntity: ItemDocumentReport::class,cascade: ['persist', 'remove'],fetch: 'EXTRA_LAZY',orphanRemoval: true)]private ?iterable $itemDocumentReport;#[ORM\Column(name: 'amount',type: 'decimal',precision: 20,scale: 2,nullable: true)]private ?string $amount = null;public function __construct(){$this->itemDocumentReport = new ArrayCollection();}public function getName(): ?string{return $this->name;}public function setName(?string $name): self{$this->name = $name;return $this;}public function getDate(): ?DateTime{return $this->date;}public function setDate(?DateTime $date): self{$this->date = $date;return $this;}public function getSubmissionDate(): ?DateTime{return $this->submissionDate;}public function setSubmissionDate(?DateTime $date): self{$this->submissionDate = $date;return $this;}public function getStatus(): ?string{return $this->status;}public function setStatus(?string $status): self{$this->status = $status;return $this;}public function getReceiver(): ?User{return $this->receiver;}public function setReceiver(?User $receiver): self{$this->receiver = $receiver;return $this;}public function getItemDocumentReport(): ?iterable{return $this->itemDocumentReport;}public function getProject(): ?Project{return $this->project;}public function setProject(?Project $project): self{$this->project = $project;return $this;}public function addItemDocumentReport(ItemDocumentReport $itemDocumentReport): void{if ($this->itemDocumentReport->contains($itemDocumentReport)) {return;}$this->itemDocumentReport[] = $itemDocumentReport;$itemDocumentReport->setReport($this);}public function removeItemDocumentReport(ItemDocumentReport $itemDocumentReport): void{if (!$this->itemDocumentReport->contains($itemDocumentReport)) {return;}$this->itemDocumentReport->removeElement($itemDocumentReport);$itemDocumentReport->setReport(null);}public function getAmount(): ?string{return $this->amount;}public function setAmount(?string $amount): self{$this->amount = $amount;return $this;}}