src/Entity/Profile/Type/Person.php line 20

Open in your IDE?
  1. <?php
  2. /*
  3.  * @since 1.0.0
  4.  * @copyright Copyright (C) 2021 ArtMedia. All rights reserved.
  5.  * @website http://artmedia.biz.pl
  6.  * @author Arkadiusz Tobiasz
  7.  * @email kontakt@artmedia.biz.pl
  8.  */
  9. namespace App\Entity\Profile\Type;
  10. use Doctrine\ORM\Mapping as ORM;
  11. use Symfony\Component\Validator\Constraints as Assert;
  12. use App\Entity\Profile;
  13. /**
  14.  * @ORM\Entity(repositoryClass="App\Repository\Profile\Type\PersonRepository")
  15.  * @ORM\Table(name="profile_person")
  16.  */
  17. class Person extends Profile
  18. {
  19.     public const GENDER_NOT_SPECIFIED 'not_specified';
  20.     public const GENDER_MALE 'male';
  21.     public const GENDER_FEMALE 'female';
  22.     public const GENDERS = [
  23.         self::GENDER_NOT_SPECIFIED,
  24.         self::GENDER_MALE,
  25.         self::GENDER_FEMALE,
  26.     ];
  27.     public const TRANSPORT_NOT_SPECIFIED 'not_specified';
  28.     public const TRANSPORT_PUBLIC 'public_transport';
  29.     public const TRANSPORT_OWN 'own_transport';
  30.     public const TRANSPORT = [
  31.         self::TRANSPORT_NOT_SPECIFIED,
  32.         self::TRANSPORT_PUBLIC,
  33.         self::TRANSPORT_OWN,
  34.     ];
  35.     /**
  36.      * @var string
  37.      *
  38.      * @ORM\Column(type="string", columnDefinition="enum('not_specified', 'public_transport', 'own_transport')")
  39.      */
  40.     private $transport self::TRANSPORT_NOT_SPECIFIED;
  41.     public function __construct()
  42.     {
  43.         parent::__construct();
  44.         $this->transport self::TRANSPORT_NOT_SPECIFIED;
  45.     }
  46.     public function getTransport(): ?string
  47.     {
  48.         return $this->transport;
  49.     }
  50.     public function setTransport(string $transport): self
  51.     {
  52.         $this->transport $transport;
  53.         return $this;
  54.     }
  55.     public function getType(): string
  56.     {
  57.         return Profile::TYPE_PERSON;
  58.     }
  59. }