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/Meov.php
<?php

namespace App\Entity;

use App\Entity\Poll\AnswerField;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;

/**
 * Meov
 */
#[ORM\Table(name: 'meov')]
#[ORM\Entity(repositoryClass: \App\Repository\MeovRepository::class)]
class Meov
{
    #[ORM\Column]
    #[ORM\Id]
    #[ORM\GeneratedValue]
    private ?int $id = null;

    /**
     * @var string
     */
    #[ORM\Column(name: 'short_name', type: 'string', length: 255, unique: true)]
    private $shortName;

    /**
     * @var string
     */
    #[ORM\Column(name: 'type', type: 'string', length: 255)]
    private $type;

    /**
     * @var string
     */
    #[ORM\Column(name: 'name', type: 'string', length: 255)]
    private $name;

    /**
     * @var int
     */
    #[ORM\Column(name: 'minHours', type: 'string', length: 255)]
    private $minMaxHours;

    #[ORM\OneToMany(mappedBy: 'meov', targetEntity: MeovLecturer::class)]
    private Collection $MeovLecturers;

    #[ORM\JoinColumn(name: 'answer_field_id', referencedColumnName: 'id', nullable: true)]
    #[ORM\ManyToOne(targetEntity: AnswerField::class, inversedBy: 'meovs')]
    private ?AnswerField $answerField;

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

    public function __toString()
    {
        return $this->name . " (" . $this->type . ", " . $this->minMaxHours . ")";
    }

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

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

    public function getMinMaxHours(): ?string
    {
        return $this->minMaxHours;
    }

    public function setId($id)
    {
        $this->id = $id;
        return $this;
    }

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

        return $this;
    }

    public function setMinMaxHours(string $minMaxHours): static
    {
        $this->minMaxHours = $minMaxHours;

        return $this;
    }

    public function getShortName(): ?string
    {
        return $this->shortName;
    }

    public function setShortName(string $shortName): static
    {
        $this->shortName = $shortName;

        return $this;
    }

    public function getType(): ?string
    {
        return $this->type;
    }

    public function setType(string $type): static
    {
        $this->type = $type;

        return $this;
    }

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

    public function setMeovLecturers($MeovLecturers)
    {
        $this->MeovLecturers = $MeovLecturers;
        return $this;
    }

    public function getAnswerField(): ?AnswerField
    {
        return $this->answerField;
    }

    public function setAnswerField(?AnswerField $answerField): static
    {
        $this->answerField = $answerField;

        return $this;
    }

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

        return $this;
    }

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

        return $this;
    }
}