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/dvpis2025/dvpis.kaunokolegija.lt/src/Entity/LecturerAgreementType.php
<?php

namespace App\Entity;

use App\Repository\LecturerAgreementTypeRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;

#[ORM\Entity(repositoryClass: LecturerAgreementTypeRepository::class)]
class LecturerAgreementType
{
    #[ORM\Id]
    #[ORM\GeneratedValue]
    #[ORM\Column]
    private ?int $id = null;

    #[ORM\Column(length: 255)]
    private ?string $name = null;

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

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

    #[ORM\Column(length: 255)]
    private ?string $code = null;

    public function __construct()
    {
        $this->lecturerAgreements = new ArrayCollection();
    }

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

    public function getName(): ?string
    {
        return $this->name;
    }

    public function setName(string $name): static
    {
        $this->name = $name;

        return $this;
    }

    public function getNameEn(): ?string
    {
        return $this->name_en;
    }

    public function setNameEn(?string $name_en): static
    {
        $this->name_en = $name_en;

        return $this;
    }

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

    public function addLecturerAgreement(LecturerAgreement $lecturerAgreement): static
    {
        if (!$this->lecturerAgreements->contains($lecturerAgreement)) {
            $this->lecturerAgreements->add($lecturerAgreement);
            $lecturerAgreement->setLecturerAgreementType($this);
        }

        return $this;
    }

    public function removeLecturerAgreement(LecturerAgreement $lecturerAgreement): static
    {
        if ($this->lecturerAgreements->removeElement($lecturerAgreement)) {
            // set the owning side to null (unless already changed)
            if ($lecturerAgreement->getLecturerAgreementType() === $this) {
                $lecturerAgreement->setLecturerAgreementType(null);
            }
        }

        return $this;
    }

    public function getCode(): ?string
    {
        return $this->code;
    }

    public function setCode(string $code): static
    {
        $this->code = $code;

        return $this;
    }
}