src/Entity/Project.php line 36
<?phpdeclare(strict_types=1);namespace App\Entity;use ApiPlatform\Core\Annotation\ApiResource;use App\Controller\Api\Action\Project\ProjectDetailsGetAction;use App\Controller\Api\Action\Project\ProjectItemGetAction;use App\Repository\ProjectRepository;use DateTime;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Validator\Constraints as Assert;#[ORM\Entity(repositoryClass: ProjectRepository::class)]#[ORM\Table(name: 'project')]#[ApiResource(collectionOperations: [],itemOperations: ['get' => ['controller' => ProjectItemGetAction::class],'details' => ['access_control' => 'is_granted("ROLE_USER")','controller' => ProjectDetailsGetAction::class,'method' => 'GET','path' => '/projects/details/{id}']])]class Project{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column(type: 'integer')]private ?int $id = null;#[ORM\Column(type: 'datetime',nullable: true)]private ?DateTime $dateCreated = null;#[ORM\Column(type: 'datetime',nullable: true)]private ?DateTime $dateChanged = null;#[ORM\ManyToOne(targetEntity: User::class,cascade: ['persist'])]#[ORM\JoinColumn(name: 'user_created',nullable: true)]private ?User $userCreated = null;#[ORM\ManyToOne(targetEntity: User::class,cascade: ['persist'])]#[ORM\JoinColumn(name: 'user_changed',nullable: true)]private ?User $userChanged = null;#[ORM\Column(name: 'color',type: 'string',length: 191,nullable: true)]#[Assert\NotBlank(groups: ['action'])]#[Assert\Length(max: 100,groups: ['action'])]private ?string $color = null;#[ORM\Column(name: 'active',type: 'boolean',options: ['default' => true])]private bool $active = true;#[ORM\Column(name: 'show_in_calendar',type: 'boolean',options: ['default' => true])]private bool $showInCalendar = true;#[ORM\Column(name: 'name',type: 'string',length: 181,nullable: true)]#[Assert\NotNull(groups: ['action'])]private ?string $name = null;#[ORM\Column(name: 'call_name',type: 'string',length: 181,nullable: true)]private ?string $callName = null;#[ORM\Column(name: 'call_code',type: 'string',length: 181,nullable: true)]private ?string $callCode = null;#[ORM\Column(name: 'conductor',type: 'string',length: 181,nullable: true)]private ?string $conductor = null;#[ORM\Column(name: 'price',type: 'decimal',precision: 20,scale: 2,nullable: true)]private ?string $price = null;#[ORM\Column(name: 'non_refundable_funds',type: 'decimal',precision: 20,scale: 2,nullable: true)]private ?string $nonRefundableFunds = null;#[ORM\Column(name: 'personal_funds',type: 'decimal',precision: 20,scale: 2,nullable: true)]private ?string $personalFunds = null;#[ORM\Column(name: 'short_name',type: 'string',length: 181,nullable: true)]private ?string $shortName = null;#[ORM\Column(name: 'short_description',type: 'text',nullable: true)]private ?string $shortDescription = null;#[ORM\Column(name: 'start_date',type: 'datetime',nullable: true)]private ?DateTime $startDate = null;#[ORM\Column(name: 'end_date',type: 'datetime',nullable: true)]private ?DateTime $endDate = null;#[ORM\Column(name: 'purpose',type: 'text',nullable: true)]private ?string $purpose = null;#[ORM\Column(name: 'sustainability',type: 'text',nullable: true)]private ?string $sustainability = null;#[ORM\Column(name: 'contact_person_pt',type: 'text',nullable: true)]private ?string $contactPersonPt = null;#[ORM\Column(name: 'notes_for_pm',type: 'text',nullable: true)]private ?string $notesForPm = null;#[ORM\Column(name: 'summary',type: 'text',nullable: true)]private ?string $summary = null;#[ORM\ManyToOne(targetEntity: Institution::class,cascade: ['persist'])]#[ORM\JoinColumn(name: 'institution')]private ?Institution $institution = null;#[ORM\ManyToOne(targetEntity: User::class,cascade: ['persist'])]#[ORM\JoinColumn(name: 'project_manager')]private ?User $projectManager = null;#[ORM\OneToMany(mappedBy: 'project',targetEntity: Item::class,cascade: ['persist'],fetch: 'EXTRA_LAZY',orphanRemoval: true)]private ?iterable $items;#[ORM\OneToMany(mappedBy: 'project',targetEntity: Report::class,cascade: ['persist'],fetch: 'EXTRA_LAZY',orphanRemoval: true)]#[Assert\Valid(groups: ['action'])]private ?iterable $reports;#[ORM\OneToMany(mappedBy: 'project',targetEntity: ProjectPartner::class,cascade: ['persist'],fetch: 'EXTRA_LAZY',orphanRemoval: true)]#[Assert\Valid(groups: ['action'])]private ?iterable $partners;#[ORM\OneToMany(mappedBy: 'project',targetEntity: Indicator::class,cascade: ['persist'],fetch: 'EXTRA_LAZY',orphanRemoval: true)]#[Assert\Valid(groups: ['action'])]private ?iterable $indicators;#[ORM\OneToMany(mappedBy: 'project',targetEntity: Goal::class,cascade: ['persist'],fetch: 'EXTRA_LAZY',orphanRemoval: true)]#[Assert\Valid(groups: ['action'])]private ?iterable $goals;public function __construct(){$this->items = new ArrayCollection();$this->reports = new ArrayCollection();$this->partners = new ArrayCollection();$this->indicators = new ArrayCollection();$this->goals = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function setId($id): self{$this->id = $id;return $this;}public function getDateCreated(): ?DateTime{return $this->dateCreated;}public function setDateCreated(?DateTime $dateCreated): self{$this->dateCreated = $dateCreated;return $this;}public function getDateChanged(): ?DateTime{return $this->dateChanged;}public function setDateChanged(?DateTime $dateChanged): self{$this->dateChanged = $dateChanged;return $this;}public function getUserCreated(): ?User{return $this->userCreated;}public function setUserCreated(?User $userCreated): self{$this->userCreated = $userCreated;return $this;}public function getUserChanged(): ?User{return $this->userChanged;}public function setUserChanged(?User $userChanged): self{$this->userChanged = $userChanged;return $this;}public function isActive(): bool{return $this->active;}public function setActive(bool $active): void{$this->active = $active;}public function isShowInCalendar(): bool{return $this->showInCalendar;}public function setShowInCalendar(bool $showInCalendar): void{$this->showInCalendar = $showInCalendar;}public function getName(): ?string{return $this->name;}public function getColor(): ?string{return $this->color;}public function setColor(?string $color): self{$this->color = $color;return $this;}public function setName(?string $name): self{$this->name = $name;return $this;}public function getCallName(): ?string{return $this->callName;}public function setCallName(?string $callName): self{$this->callName = $callName;return $this;}public function getCallCode(): ?string{return $this->callCode;}public function setCallCode(?string $callCode): self{$this->callCode = $callCode;return $this;}public function getConductor(): ?string{return $this->conductor;}public function setConductor(?string $conductor): self{$this->conductor = $conductor;return $this;}public function getPrice(): ?string{return $this->price;}public function setPrice(?string $price): self{$this->price = $price;return $this;}public function getNonRefundableFunds(): ?string{return $this->nonRefundableFunds;}public function setNonRefundableFunds(?string $nonRefundableFunds): self{$this->nonRefundableFunds = $nonRefundableFunds;return $this;}public function getPersonalFunds(): ?string{return $this->personalFunds;}public function setPersonalFunds(?string $personalFunds): self{$this->personalFunds = $personalFunds;return $this;}public function getItems(): iterable{return $this->items;}public function getShortName(): ?string{return $this->shortName;}public function setShortName(?string $shortName): self{$this->shortName = $shortName;return $this;}public function getShortDescription(): ?string{return $this->shortDescription;}public function setShortDescription(?string $shortDescription): self{$this->shortDescription = $shortDescription;return $this;}public function getStartDate(): ?DateTime{return $this->startDate;}public function setStartDate(?DateTime $startDate): self{$this->startDate = $startDate;return $this;}public function getEndDate(): ?DateTime{return $this->endDate;}public function setEndDate(?DateTime $endDate): self{$this->endDate = $endDate;return $this;}public function getPurpose(): ?string{return $this->purpose;}public function setPurpose(?string $purpose): self{$this->purpose = $purpose;return $this;}public function getSustainability(): ?string{return $this->sustainability;}public function setSustainability(?string $sustainability): self{$this->sustainability = $sustainability;return $this;}public function getContactPersonPt(): ?string{return $this->contactPersonPt;}public function setContactPersonPt(?string $contactPersonPt): self{$this->contactPersonPt = $contactPersonPt;return $this;}public function getNotesForPm(): ?string{return $this->notesForPm;}public function setNotesForPm(?string $notesForPm): self{$this->notesForPm = $notesForPm;return $this;}public function getSummary(): ?string{return $this->summary;}public function setSummary(?string $summary): self{$this->summary = $summary;return $this;}public function getInstitution(): ?Institution{return $this->institution;}public function setInstitution(?Institution $institution): self{$this->institution = $institution;return $this;}public function getProjectManager(): ?User{return $this->projectManager;}public function setProjectManager(?User $projectManager): self{$this->projectManager = $projectManager;return $this;}public function addItem(Item $item): void{if ($this->items->contains($item)) {return;}$this->items[] = $item;$item->setProject($this);}public function removeItem(Item $item): void{if (!$this->items->contains($item)) {return;}$this->items->removeElement($item);$item->setProject(null);}public function getReports(): iterable{return $this->reports;}public function addReport(Report $report): void{if ($this->reports->contains($report)) {return;}$this->reports[] = $report;$report->setProject($this);}public function removeReport(Report $report): void{if (!$this->reports->contains($report)) {return;}$this->reports->removeElement($report);$report->setProject(null);}public function getPartners(): iterable{return $this->partners;}public function addPartner(ProjectPartner $partner): void{if ($this->partners->contains($partner)) {return;}$this->partners[] = $partner;$partner->setProject($this);}public function removePartner(ProjectPartner $partner): void{if (!$this->partners->contains($partner)) {return;}$this->partners->removeElement($partner);$partner->setProject(null);}public function getIndicators(): iterable{return $this->indicators;}public function getGoals(): iterable{return $this->goals;}public function addGoal(Goal $goal): void{if ($this->goals->contains($goal)) {return;}$this->goals[] = $goal;$goal->setProject($this);}public function removeGoal(Goal $goal): void{if (!$this->goals->contains($goal)) {return;}$this->goals->removeElement($goal);$goal->setProject(null);}public function addIndicator(Indicator $indicator): void{if ($this->indicators->contains($indicator)) {return;}$this->indicators[] = $indicator;$indicator->setProject($this);}public function removeIndicator(Indicator $indicator): void{if (!$this->indicators->contains($indicator)) {return;}$this->indicators->removeElement($indicator);$indicator->setProject(null);}}