HEX
Server: Apache
System: Linux WWW 6.1.0-40-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.153-1 (2025-09-20) x86_64
User: web11 (1011)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /var/www/dvpis2026/dvpis.kaunokolegija.lt/src/Entity/FiveYearLecturerPlan.php
<?php

namespace App\Entity;

use App\Repository\FiveYearLecturerPlanRepository;
use DateTimeInterface;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;

#[ORM\Entity(repositoryClass: FiveYearLecturerPlanRepository::class)]
#[ORM\Table(name: 'five_year_lecturer_plan')]
#[UniqueEntity(fields: ['ActivitiesGroupLecturerPositionActivity', 'lecturerAgreement'], message: 'Toks įrašas jau egzistuoja', errorPath: 'entity')]
class FiveYearLecturerPlan
{
    #[ORM\Id]
    #[ORM\GeneratedValue]
    #[ORM\Column]
    private ?int $id = null;

    /**
     * @var DateTimeInterface|null
     */
    #[ORM\Column(type: Types::DATE_MUTABLE, nullable: true)]
    private ?\DateTimeInterface $planYear = null;

    #[ORM\Column(length: 255, nullable: true)]
    private ?string $quality = null;

    #[ORM\Column(length: 255, nullable: true)]
    private ?string $quantity = null;

    /**
     * @var DateTimeInterface|null
     */
    #[ORM\Column(type: Types::DATE_MUTABLE, nullable: true)]
    private ?\DateTimeInterface $factYear = null;

    #[ORM\Column(length: 255, nullable: true)]
    private ?string $factActivity = null;


    #[ORM\ManyToOne(inversedBy: 'fiveYearLecturerPlans')]
    #[ORM\JoinColumn(name: 'activities_group_lecturer_position_activity', referencedColumnName: 'id')]
    private ?ActivitiesGroupLecturerPositionActivities $ActivitiesGroupLecturerPositionActivity = null;


    #[ORM\ManyToOne(inversedBy: 'fiveYearLecturerPlans')]
    #[ORM\JoinColumn(name: 'lecturer_aggreement_id', referencedColumnName: 'id')]
    private ?LecturerAgreement $lecturerAgreement = null;

    #[ORM\Column(nullable: true)]
    private ?int $year1 = null;

    #[ORM\Column(nullable: true)]
    private ?int $year2 = null;

    #[ORM\Column(nullable: true)]
    private ?int $year3 = null;

    #[ORM\Column(nullable: true)]
    private ?int $year4 = null;

    #[ORM\Column(nullable: true)]
    private ?int $year5 = null;

    /**
     * @var Collection<int, KtvLecturer>
     */
    #[ORM\OneToMany(mappedBy: 'fiveYearLecturerPlan', targetEntity: KtvLecturer::class)]
    private Collection $KtvLecturer;

    /**
     * @var Collection<int, MeovLecturer>
     */
    #[ORM\OneToMany(mappedBy: 'fiveYearLecturerPlan', targetEntity: MeovLecturer::class)]
    private Collection $MeovLecturer;

    /**
     * @var Collection<int, TmmvLecturer>
     */
    #[ORM\OneToMany(mappedBy: 'fiveYearLecturerPlan', targetEntity: TmmvLecturer::class)]
    private Collection $TmmvLecturer;

    public function __construct()
    {
        $this->KtvLecturer = new ArrayCollection();
        $this->MeovLecturer = new ArrayCollection();
        $this->TmmvLecturer = new ArrayCollection();
    }

    public function getId(): ?int
    {
        return $this->id;
    }

    public function getPlanYear(): ?\DateTimeInterface
    {
        return $this->planYear;
    }

    public function setPlanYear(?\DateTimeInterface $planYear): static
    {
        $this->planYear = $planYear;

        return $this;
    }

    public function getQuality(): ?string
    {
        return $this->quality;
    }

    public function setQuality(?string $quality): static
    {
        $this->quality = $quality;

        return $this;
    }

    public function getQuantity(): ?string
    {
        return $this->quantity;
    }

    public function setQuantity(?string $quantity): static
    {
        $this->quantity = $quantity;

        return $this;
    }

    public function getFactYear(): ?\DateTimeInterface
    {
        return $this->factYear;
    }

    public function setFactYear(?\DateTimeInterface $factYear): static
    {
        $this->factYear = $factYear;

        return $this;
    }

    public function getFactActivity(): ?string
    {
        return $this->factActivity;
    }

    public function setFactActivity(?string $factActivity): static
    {
        $this->factActivity = $factActivity;

        return $this;
    }

    public function getActivitiesGroupLecturerPositionActivity(): ?ActivitiesGroupLecturerPositionActivities
    {
        return $this->ActivitiesGroupLecturerPositionActivity;
    }

    public function setActivitiesGroupLecturerPositionActivity(?ActivitiesGroupLecturerPositionActivities $ActivitiesGroupLecturerPositionActivity): static
    {
        $this->ActivitiesGroupLecturerPositionActivity = $ActivitiesGroupLecturerPositionActivity;

        return $this;
    }

    public function getLecturerAgreement(): ?LecturerAgreement
    {
        return $this->lecturerAgreement;
    }

    public function setLecturerAgreement(?LecturerAgreement $lecturerAgreement): static
    {
        $this->lecturerAgreement = $lecturerAgreement;

        return $this;
    }

    public function getYear1(): ?bool
    {
        return $this->year1 === 1;
    }

    public function setYear1(?bool $year1): static
    {
        $this->year1 = $year1;

        return $this;
    }

    public function getYear2(): ?bool
    {
        return $this->year2 === 1;
    }

    public function setYear2(?int $year2): static
    {
        $this->year2 = $year2;

        return $this;
    }

    public function getYear3(): ?bool
    {
        return $this->year3 === 1;
    }

    public function setYear3(?int $year3): static
    {
        $this->year3 = $year3;

        return $this;
    }

    public function getYear4(): ?bool
    {
        return $this->year4 === 1;
    }

    public function setYear4(?int $year4): static
    {
        $this->year4 = $year4;

        return $this;
    }

    public function getYear5(): ?bool
    {
        return $this->year5 === 1;
    }

    public function setYear5(?int $year5): static
    {
        $this->year5 = $year5;

        return $this;
    }

    /**
     * @return Collection<int, KtvLecturer>
     */
    public function getKtvLecturer(): Collection
    {
        return $this->KtvLecturer;
    }

    public function addKtvLecturer(KtvLecturer $ktvLecturer): static
    {
        if (!$this->KtvLecturer->contains($ktvLecturer)) {
            $this->KtvLecturer->add($ktvLecturer);
            $ktvLecturer->setFiveYearLecturerPlan($this);
        }

        return $this;
    }

    public function removeKtvLecturer(KtvLecturer $ktvLecturer): static
    {
        if ($this->KtvLecturer->removeElement($ktvLecturer)) {
            // set the owning side to null (unless already changed)
            if ($ktvLecturer->getFiveYearLecturerPlan() === $this) {
                $ktvLecturer->setFiveYearLecturerPlan(null);
            }
        }

        return $this;
    }

    /**
     * @return Collection<int, MeovLecturer>
     */
    public function getMeovLecturer(): Collection
    {
        return $this->MeovLecturer;
    }

    public function addMeovLecturer(MeovLecturer $meovLecturer): static
    {
        if (!$this->MeovLecturer->contains($meovLecturer)) {
            $this->MeovLecturer->add($meovLecturer);
            $meovLecturer->setFiveYearLecturerPlan($this);
        }

        return $this;
    }

    public function removeMeovLecturer(MeovLecturer $meovLecturer): static
    {
        if ($this->MeovLecturer->removeElement($meovLecturer)) {
            // set the owning side to null (unless already changed)
            if ($meovLecturer->getFiveYearLecturerPlan() === $this) {
                $meovLecturer->setFiveYearLecturerPlan(null);
            }
        }

        return $this;
    }

    /**
     * @return Collection<int, TmmvLecturer>
     */
    public function getTmmvLecturer(): Collection
    {
        return $this->TmmvLecturer;
    }

    public function addTmmvLecturer(TmmvLecturer $tmmvLecturer): static
    {
        if (!$this->TmmvLecturer->contains($tmmvLecturer)) {
            $this->TmmvLecturer->add($tmmvLecturer);
            $tmmvLecturer->setFiveYearLecturerPlan($this);
        }

        return $this;
    }

    public function removeTmmvLecturer(TmmvLecturer $tmmvLecturer): static
    {
        if ($this->TmmvLecturer->removeElement($tmmvLecturer)) {
            // set the owning side to null (unless already changed)
            if ($tmmvLecturer->getFiveYearLecturerPlan() === $this) {
                $tmmvLecturer->setFiveYearLecturerPlan(null);
            }
        }

        return $this;
    }

    public function __toString(): string
    {
        return
            $this->getActivitiesGroupLecturerPositionActivity()->getLecturerPosition()->getName()
            . ' (' . $this->getActivitiesGroupLecturerPositionActivity()->getActivitiesGroupId()->getName()
            . ') ' . $this->getActivitiesGroupLecturerPositionActivity()->getLecturerPositionActivityId()->getName()
        ;
    }
}