src/Entity/Organisation/SuccessHistory.php line 22

  1. <?php
  2. namespace App\Entity\Organisation;
  3. use App\Entity\Common\File;
  4. use App\Entity\Olympiad\Olympiad;
  5. use App\Entity\Traits\ActiveTrait;
  6. use App\Entity\Traits\TrackerFields;
  7. use App\Entity\Traits\UserCreatedInterface;
  8. use App\Entity\Traits\UserUpdatedInterface;
  9. use Doctrine\Common\Collections\ArrayCollection;
  10. use Doctrine\Common\Collections\Collection;
  11. use Doctrine\ORM\Mapping as ORM;
  12. /**
  13.  * Class OlympPrivileges
  14.  * @package App\Entity\Organisation
  15.  */
  16. #[ORM\Table(name'organisation_success_history')]
  17. #[ORM\Entity(repositoryClass'App\Repository\Organisation\SuccessHistoryRepository')]
  18. #[ORM\HasLifecycleCallbacks]
  19. class SuccessHistory implements UserCreatedInterfaceUserUpdatedInterface
  20. {
  21.     use TrackerFields;
  22.     use ActiveTrait;
  23.     /**
  24.      * @var ?integer
  25.      */
  26.     #[ORM\Id]
  27.     #[ORM\GeneratedValue(strategy'AUTO')]
  28.     #[ORM\Column(type'integer')]
  29.     private $id;
  30.     /**
  31.      * @var ?string
  32.      */
  33.     #[ORM\Column(type'string'nullabletrue)]
  34.     private $surname;
  35.     /**
  36.      * @var ?string
  37.      */
  38.     #[ORM\Column(type'string'nullabletrue)]
  39.     private $firstname;
  40.     /**
  41.      * @var ?string
  42.      */
  43.     #[ORM\Column(type'string'nullabletrue)]
  44.     private $fathername;
  45.     /**
  46.      * @var File|null
  47.      */
  48.     #[ORM\ManyToOne(targetEntity'App\Entity\Common\File'cascade: ['remove''persist'])]
  49.     private $photo;
  50.     /**
  51.      * @var ?Organisation
  52.      */
  53.     #[ORM\ManyToOne(targetEntity'App\Entity\Organisation\Organisation'inversedBy'olymp_privileges')]
  54.     #[ORM\JoinColumn(nullablefalse)]
  55.     private $organisation;
  56.     /**
  57.      * @var Olympiad[]|Collection
  58.      */
  59.     #[ORM\JoinTable(name'organisation_success_history_olympiad_relation')]
  60.     #[ORM\ManyToMany(targetEntity'App\Entity\Olympiad\Olympiad'inversedBy'success_history')]
  61.     private $olympiads;
  62.     /**
  63.      * @var ?string
  64.      */
  65.     #[ORM\Column(type'text'nullabletrue)]
  66.     private $history;
  67.     /**
  68.      * @var
  69.      */
  70.     #[ORM\Column(type'string'nullabletrue)]
  71.     private $history_short;
  72.     public function __construct()
  73.     {
  74. //        $this->olympiads=new ArrayCollection();
  75.     }
  76.     public function getFullname()
  77.     {
  78.         return trim(str_replace('  '' 'sprintf('%s %s %s'$this->firstname$this->fathername$this->surname)));
  79.     }
  80.     /**
  81.      * @return int|null
  82.      */
  83.     public function getId(): ?int
  84.     {
  85.         return $this->id;
  86.     }
  87.     /**
  88.      * @param int|null $id
  89.      */
  90.     public function setId(?int $id): void
  91.     {
  92.         $this->id $id;
  93.     }
  94.     /**
  95.      * @return Organisation|null
  96.      */
  97.     public function getOrganisation(): ?Organisation
  98.     {
  99.         return $this->organisation;
  100.     }
  101.     /**
  102.      * @param Organisation|null $organisation
  103.      */
  104.     public function setOrganisation(?Organisation $organisation): void
  105.     {
  106.         $this->organisation $organisation;
  107.     }
  108.     /**
  109.      * @return string|null
  110.      */
  111.     public function getHistory(): ?string
  112.     {
  113.         return $this->history;
  114.     }
  115.     /**
  116.      * @param string|null $history
  117.      */
  118.     public function setHistory(?string $history): void
  119.     {
  120.         $this->history $history;
  121.     }
  122.     /**
  123.      * @return File|null
  124.      */
  125.     public function getPhoto(): ?File
  126.     {
  127.         return $this->photo;
  128.     }
  129.     /**
  130.      * @param File|null $photo
  131.      */
  132.     public function setPhoto(?File $photo): void
  133.     {
  134.         $this->photo $photo;
  135.     }
  136.     /**
  137.      * @return string|null
  138.      */
  139.     public function getSurname(): ?string
  140.     {
  141.         return $this->surname;
  142.     }
  143.     /**
  144.      * @param string|null $surname
  145.      */
  146.     public function setSurname(?string $surname): void
  147.     {
  148.         $this->surname $surname;
  149.     }
  150.     /**
  151.      * @return string|null
  152.      */
  153.     public function getFirstname(): ?string
  154.     {
  155.         return $this->firstname;
  156.     }
  157.     /**
  158.      * @param string|null $firstname
  159.      */
  160.     public function setFirstname(?string $firstname): void
  161.     {
  162.         $this->firstname $firstname;
  163.     }
  164.     /**
  165.      * @return string|null
  166.      */
  167.     public function getFathername(): ?string
  168.     {
  169.         return $this->fathername;
  170.     }
  171.     /**
  172.      * @param string|null $fathername
  173.      */
  174.     public function setFathername(?string $fathername): void
  175.     {
  176.         $this->fathername $fathername;
  177.     }
  178.     /**
  179.      * @return Olympiad[]|Collection
  180.      */
  181.     public function getOlympiads()
  182.     {
  183.         return $this->olympiads;
  184.     }
  185.     /**
  186.      * @param Olympiad[]|Collection $olympiads
  187.      */
  188.     public function setOlympiads($olympiads): void
  189.     {
  190.         $this->olympiads $olympiads;
  191.     }
  192.     /**
  193.      * @return mixed
  194.      */
  195.     public function getHistoryShort()
  196.     {
  197.         return $this->history_short;
  198.     }
  199.     /**
  200.      * @param mixed $history_short
  201.      */
  202.     public function setHistoryShort($history_short): void
  203.     {
  204.         $this->history_short $history_short;
  205.     }
  206. }