2024-10-17 17:56:46 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Entity;
|
|
|
|
|
|
|
|
use App\Repository\InternRepository;
|
|
|
|
use Doctrine\Common\Collections\ArrayCollection;
|
|
|
|
use Doctrine\Common\Collections\Collection;
|
|
|
|
use Doctrine\DBAL\Types\Types;
|
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
|
|
|
|
#[ORM\Entity(repositoryClass: InternRepository::class)]
|
|
|
|
class Intern extends UserApp
|
|
|
|
{
|
|
|
|
|
|
|
|
#[ORM\Column(type: Types::TEXT)]
|
|
|
|
private ?string $coverLetter = null;
|
|
|
|
|
|
|
|
#[ORM\Column(length: 255)]
|
|
|
|
private ?string $resume = null;
|
|
|
|
|
|
|
|
/**
|
2024-10-17 17:56:46 +02:00
|
|
|
* @var Collection<int, Announcement>
|
2024-10-17 17:56:46 +02:00
|
|
|
*/
|
2024-10-17 17:56:46 +02:00
|
|
|
#[ORM\ManyToMany(targetEntity: Announcement::class, inversedBy: 'interns')]
|
|
|
|
#[ORM\JoinTable(name: 'favorites')]
|
|
|
|
private Collection $favorites;
|
2024-10-17 17:56:46 +02:00
|
|
|
|
|
|
|
/**
|
2024-10-17 17:56:46 +02:00
|
|
|
* @var Collection<int, Announcement>
|
2024-10-17 17:56:46 +02:00
|
|
|
*/
|
2024-10-17 17:56:46 +02:00
|
|
|
#[ORM\ManyToMany(targetEntity: Announcement::class, inversedBy: 'applicants')]
|
|
|
|
#[ORM\JoinTable(name: 'applications')]
|
2024-10-17 17:56:46 +02:00
|
|
|
private Collection $applications;
|
|
|
|
|
|
|
|
/**
|
2024-10-17 17:56:46 +02:00
|
|
|
* @var Collection<int, Skill>
|
2024-10-17 17:56:46 +02:00
|
|
|
*/
|
2024-10-17 17:56:46 +02:00
|
|
|
#[ORM\ManyToMany(targetEntity: Skill::class, inversedBy: 'interns')]
|
|
|
|
private Collection $skills;
|
2024-10-17 17:56:46 +02:00
|
|
|
|
|
|
|
public function __construct()
|
|
|
|
{
|
2024-11-10 15:41:01 +01:00
|
|
|
$this->favorites = new ArrayCollection();
|
2024-10-17 17:56:46 +02:00
|
|
|
$this->applications = new ArrayCollection();
|
|
|
|
$this->skills = new ArrayCollection();
|
2024-10-17 17:56:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function getCoverLetter(): ?string
|
|
|
|
{
|
|
|
|
return $this->coverLetter;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setCoverLetter(string $coverLetter): static
|
|
|
|
{
|
|
|
|
$this->coverLetter = $coverLetter;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getResume(): ?string
|
|
|
|
{
|
|
|
|
return $this->resume;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setResume(string $resume): static
|
|
|
|
{
|
|
|
|
$this->resume = $resume;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2024-10-17 17:56:46 +02:00
|
|
|
* @return Collection<int, Announcement>
|
2024-10-17 17:56:46 +02:00
|
|
|
*/
|
2024-10-17 17:56:46 +02:00
|
|
|
public function getFavorites(): Collection
|
2024-11-10 15:41:01 +01:00
|
|
|
{
|
2024-10-17 17:56:46 +02:00
|
|
|
return $this->favorites;
|
2024-11-10 15:41:01 +01:00
|
|
|
}
|
|
|
|
|
2024-10-17 17:56:46 +02:00
|
|
|
public function addFavorite(Announcement $favorite): static
|
2024-11-10 15:41:01 +01:00
|
|
|
{
|
2024-10-17 17:56:46 +02:00
|
|
|
if (!$this->favorites->contains($favorite)) {
|
|
|
|
$this->favorites->add($favorite);
|
2024-11-10 15:41:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2024-10-17 17:56:46 +02:00
|
|
|
public function removeFavorite(Announcement $favorite): static
|
2024-11-10 15:41:01 +01:00
|
|
|
{
|
2024-10-17 17:56:46 +02:00
|
|
|
$this->favorites->removeElement($favorite);
|
2024-11-10 15:41:01 +01:00
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2024-10-17 17:56:46 +02:00
|
|
|
* @return Collection<int, Announcement>
|
2024-10-17 17:56:46 +02:00
|
|
|
*/
|
|
|
|
public function getApplications(): Collection
|
|
|
|
{
|
|
|
|
return $this->applications;
|
|
|
|
}
|
|
|
|
|
2024-10-17 17:56:46 +02:00
|
|
|
public function addApplication(Announcement $application): static
|
2024-10-17 17:56:46 +02:00
|
|
|
{
|
|
|
|
if (!$this->applications->contains($application)) {
|
|
|
|
$this->applications->add($application);
|
|
|
|
}
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2024-10-17 17:56:46 +02:00
|
|
|
public function removeApplication(Announcement $application): static
|
2024-10-17 17:56:46 +02:00
|
|
|
{
|
2024-10-17 17:56:46 +02:00
|
|
|
$this->applications->removeElement($application);
|
2024-10-17 17:56:46 +02:00
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2024-10-17 17:56:46 +02:00
|
|
|
* @return Collection<int, Skill>
|
2024-10-17 17:56:46 +02:00
|
|
|
*/
|
2024-10-17 17:56:46 +02:00
|
|
|
public function getSkills(): Collection
|
2024-10-17 17:56:46 +02:00
|
|
|
{
|
2024-10-17 17:56:46 +02:00
|
|
|
return $this->skills;
|
2024-10-17 17:56:46 +02:00
|
|
|
}
|
|
|
|
|
2024-10-17 17:56:46 +02:00
|
|
|
public function addSkill(Skill $skill): static
|
2024-10-17 17:56:46 +02:00
|
|
|
{
|
2024-10-17 17:56:46 +02:00
|
|
|
if (!$this->skills->contains($skill)) {
|
|
|
|
$this->skills->add($skill);
|
2024-10-17 17:56:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2024-10-17 17:56:46 +02:00
|
|
|
public function removeSkill(Skill $skill): static
|
2024-10-17 17:56:46 +02:00
|
|
|
{
|
2024-10-17 17:56:46 +02:00
|
|
|
$this->skills->removeElement($skill);
|
2024-10-17 17:56:46 +02:00
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
}
|