src/Entity/Organisation/SuccessHistory.php line 22
<?php
namespace App\Entity\Organisation;
use App\Entity\Common\File;
use App\Entity\Olympiad\Olympiad;
use App\Entity\Traits\ActiveTrait;
use App\Entity\Traits\TrackerFields;
use App\Entity\Traits\UserCreatedInterface;
use App\Entity\Traits\UserUpdatedInterface;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* Class OlympPrivileges
* @package App\Entity\Organisation
*/
#[ORM\Table(name: 'organisation_success_history')]
#[ORM\Entity(repositoryClass: 'App\Repository\Organisation\SuccessHistoryRepository')]
#[ORM\HasLifecycleCallbacks]
class SuccessHistory implements UserCreatedInterface, UserUpdatedInterface
{
use TrackerFields;
use ActiveTrait;
/**
* @var ?integer
*/
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'AUTO')]
#[ORM\Column(type: 'integer')]
private $id;
/**
* @var ?string
*/
#[ORM\Column(type: 'string', nullable: true)]
private $surname;
/**
* @var ?string
*/
#[ORM\Column(type: 'string', nullable: true)]
private $firstname;
/**
* @var ?string
*/
#[ORM\Column(type: 'string', nullable: true)]
private $fathername;
/**
* @var File|null
*/
#[ORM\ManyToOne(targetEntity: 'App\Entity\Common\File', cascade: ['remove', 'persist'])]
private $photo;
/**
* @var ?Organisation
*/
#[ORM\ManyToOne(targetEntity: 'App\Entity\Organisation\Organisation', inversedBy: 'olymp_privileges')]
#[ORM\JoinColumn(nullable: false)]
private $organisation;
/**
* @var Olympiad[]|Collection
*/
#[ORM\JoinTable(name: 'organisation_success_history_olympiad_relation')]
#[ORM\ManyToMany(targetEntity: 'App\Entity\Olympiad\Olympiad', inversedBy: 'success_history')]
private $olympiads;
/**
* @var ?string
*/
#[ORM\Column(type: 'text', nullable: true)]
private $history;
/**
* @var
*/
#[ORM\Column(type: 'string', nullable: true)]
private $history_short;
public function __construct()
{
// $this->olympiads=new ArrayCollection();
}
public function getFullname()
{
return trim(str_replace(' ', ' ', sprintf('%s %s %s', $this->firstname, $this->fathername, $this->surname)));
}
/**
* @return int|null
*/
public function getId(): ?int
{
return $this->id;
}
/**
* @param int|null $id
*/
public function setId(?int $id): void
{
$this->id = $id;
}
/**
* @return Organisation|null
*/
public function getOrganisation(): ?Organisation
{
return $this->organisation;
}
/**
* @param Organisation|null $organisation
*/
public function setOrganisation(?Organisation $organisation): void
{
$this->organisation = $organisation;
}
/**
* @return string|null
*/
public function getHistory(): ?string
{
return $this->history;
}
/**
* @param string|null $history
*/
public function setHistory(?string $history): void
{
$this->history = $history;
}
/**
* @return File|null
*/
public function getPhoto(): ?File
{
return $this->photo;
}
/**
* @param File|null $photo
*/
public function setPhoto(?File $photo): void
{
$this->photo = $photo;
}
/**
* @return string|null
*/
public function getSurname(): ?string
{
return $this->surname;
}
/**
* @param string|null $surname
*/
public function setSurname(?string $surname): void
{
$this->surname = $surname;
}
/**
* @return string|null
*/
public function getFirstname(): ?string
{
return $this->firstname;
}
/**
* @param string|null $firstname
*/
public function setFirstname(?string $firstname): void
{
$this->firstname = $firstname;
}
/**
* @return string|null
*/
public function getFathername(): ?string
{
return $this->fathername;
}
/**
* @param string|null $fathername
*/
public function setFathername(?string $fathername): void
{
$this->fathername = $fathername;
}
/**
* @return Olympiad[]|Collection
*/
public function getOlympiads()
{
return $this->olympiads;
}
/**
* @param Olympiad[]|Collection $olympiads
*/
public function setOlympiads($olympiads): void
{
$this->olympiads = $olympiads;
}
/**
* @return mixed
*/
public function getHistoryShort()
{
return $this->history_short;
}
/**
* @param mixed $history_short
*/
public function setHistoryShort($history_short): void
{
$this->history_short = $history_short;
}
}