src/Aviatur/AdminBundle/Entity/AdminUser.php line 15

Open in your IDE?
  1. <?php
  2. namespace Aviatur\AdminBundle\Entity;
  3. use Aviatur\AgencyBundle\Entity\Agency;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Sonata\UserBundle\Entity\BaseUser as BaseUser;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use Doctrine\Common\Collections\Collection;
  8. /**
  9.  * @ORM\Table(name="fos_user_user")
  10.  * @ORM\Entity
  11.  */
  12. class AdminUser extends BaseUser
  13. {
  14.     /**
  15.      * @var int
  16.      *
  17.      * @ORM\Column(name="id", type="integer", nullable=false)
  18.      * @ORM\Id
  19.      * @ORM\GeneratedValue(strategy="IDENTITY")
  20.      */
  21.     protected $id;
  22.     /**
  23.      * @var string
  24.      *
  25.      * @ORM\Column(name="firstname", type="string", length=64, nullable=true)
  26.      */
  27.     protected $firstname;
  28.     /**
  29.      * @var string
  30.      *
  31.      * @ORM\Column(name="lastname", type="string", length=64, nullable=true)
  32.      */
  33.     protected $lastname;
  34.     /**
  35.      * @var int|null
  36.      *
  37.      * @ORM\Column(name="locked", type="integer", nullable=true, options={"default" : 0 })
  38.      */
  39.     protected $locked 0;
  40.     /**
  41.      * @var int|null
  42.      *
  43.      * @ORM\Column(name="expired", type="integer", nullable=true, options={"default" : 0 })
  44.      */
  45.     protected $expired 0;
  46.     /**
  47.      * @var int|null
  48.      *
  49.      * @ORM\Column(name="credentials_expired", type="integer", nullable=true, options={"default" : 0 })
  50.      */
  51.     protected $credentialsExpired 0;
  52.     // --- Original AdminUser Relations ---
  53.     /** * @var Collection
  54.      */
  55.     private $activityLog;
  56.     /** * @var Collection
  57.      */
  58.     private $content;
  59.     /**
  60.      * @ORM\OneToMany(targetEntity="Aviatur\GeneralBundle\Entity\UserAgency", mappedBy="user", cascade={"persist", "remove"})
  61.      */
  62.     private $userAgency;
  63.     protected $customer;
  64.     /**
  65.      * @var Agency
  66.      *
  67.      * @ORM\ManyToOne(targetEntity="Aviatur\AgencyBundle\Entity\Agency", inversedBy="adminUsers")
  68.      * @ORM\JoinColumn(name="agency_id", referencedColumnName="id", nullable=true)
  69.      */
  70.     private ?Agency $agency null;
  71.     // --- Relations Merged from FosUserUser ---
  72.     /**
  73.      * @ORM\OneToMany(targetEntity="Aviatur\FlightBundle\Entity\ChurningActivityLog", mappedBy="order", cascade={"all"})
  74.      */
  75.     private $churningActivityLog;
  76.     /**
  77.      * @ORM\OneToMany(targetEntity="Aviatur\GeneralBundle\Entity\NameWhitelistActivityLog", mappedBy="fosUserUser", cascade={"all"})
  78.      */
  79.     private $nameWhitelistActivityLog;
  80.     /**
  81.      * @ORM\OneToMany(targetEntity="Aviatur\GeneralBundle\Entity\NameBlacklistActivityLog", mappedBy="fosUserUser", cascade={"all"})
  82.      */
  83.     private $nameBlacklistActivityLog;
  84.     /**
  85.      * @ORM\OneToMany(targetEntity="Aviatur\GeneralBundle\Entity\DocumentBlacklistActivityLog", mappedBy="fosUserUser", cascade={"all"})
  86.      */
  87.     private $documentBlacklistActivityLog;
  88.     /**
  89.      * @ORM\OneToMany(targetEntity="Aviatur\FlightBundle\Entity\ConfigFlightAgencyActivityLog", mappedBy="fosUserUser", cascade={"all"})
  90.      */
  91.     private $configFlightAgencyActivityLog;
  92.     /**
  93.      * Constructor.
  94.      */
  95.     public function __construct()
  96.     {
  97.         // Only call parent constructor if it actually exists
  98.         if (method_exists(get_parent_class($this), '__construct')) {
  99.             parent::__construct();
  100.         }
  101.         // Collections from original AdminUser
  102.         $this->activityLog = new ArrayCollection();
  103.         $this->content = new ArrayCollection();
  104.         $this->userAgency = new ArrayCollection();
  105.         // Collections merged from FosUserUser
  106.         $this->churningActivityLog = new ArrayCollection();
  107.         $this->nameWhitelistActivityLog = new ArrayCollection();
  108.         $this->nameBlacklistActivityLog = new ArrayCollection();
  109.         $this->documentBlacklistActivityLog = new ArrayCollection();
  110.         $this->configFlightAgencyActivityLog = new ArrayCollection();
  111.     }
  112.     /**
  113.      * Get id.
  114.      *
  115.      * @return int $id
  116.      */
  117.     public function getId()
  118.     {
  119.         return $this->id;
  120.     }
  121.     /**
  122.      * Set firstname.
  123.      *
  124.      * @param string $firstname
  125.      *
  126.      * @return $this
  127.      */
  128.     public function setFirstname($firstname)
  129.     {
  130.         $this->firstname $firstname;
  131.         return $this;
  132.     }
  133.     /**
  134.      * Get firstname.
  135.      *
  136.      * @return string
  137.      */
  138.     public function getFirstname()
  139.     {
  140.         return $this->firstname;
  141.     }
  142.     /**
  143.      * Set lastname.
  144.      *
  145.      * @param string $lastname
  146.      *
  147.      * @return $this
  148.      */
  149.     public function setLastname($lastname)
  150.     {
  151.         $this->lastname $lastname;
  152.         return $this;
  153.     }
  154.     /**
  155.      * Get lastname.
  156.      *
  157.      * @return string
  158.      */
  159.     public function getLastname()
  160.     {
  161.         return $this->lastname;
  162.     }
  163.     // --- Methods from original AdminUser ---
  164.     public function addActivityLog(\Aviatur\GeneralBundle\Entity\ActivityLog $activityLog)
  165.     {
  166.         $this->activityLog[] = $activityLog;
  167.         return $this;
  168.     }
  169.     public function removeActivityLog(\Aviatur\GeneralBundle\Entity\ActivityLog $activityLog)
  170.     {
  171.         $this->activityLog->removeElement($activityLog);
  172.     }
  173.     public function getActivityLog()
  174.     {
  175.         return $this->activityLog;
  176.     }
  177.     public function addContent(\Aviatur\ContentBundle\Entity\Content $content)
  178.     {
  179.         $this->content[] = $content;
  180.         return $this;
  181.     }
  182.     public function removeContent(\Aviatur\ContentBundle\Entity\Content $content)
  183.     {
  184.         $this->content->removeElement($content);
  185.     }
  186.     public function getContent()
  187.     {
  188.         return $this->content;
  189.     }
  190.     public function addUserAgency(\Aviatur\GeneralBundle\Entity\UserAgency $userAgency)
  191.     {
  192.         $this->userAgency[] = $userAgency;
  193.         return $this;
  194.     }
  195.     /**
  196.      * Note: The type hint in your original file for remove was Markup,
  197.      * but logically it should be UserAgency. Check this if you get errors.
  198.      */
  199.     public function removeUserAgency($userAgency)
  200.     {
  201.         $this->userAgency->removeElement($userAgency);
  202.     }
  203.     public function getUserAgency()
  204.     {
  205.         return $this->userAgency;
  206.     }
  207.     public function setCustomer(\Aviatur\CustomerBundle\Entity\Customer $customer null)
  208.     {
  209.         $this->customer $customer;
  210.         return $this;
  211.     }
  212.     public function getCustomer()
  213.     {
  214.         return $this->customer;
  215.     }
  216.     // --- Methods Merged from FosUserUser ---
  217.     public function addChurningActivityLog(\Aviatur\FlightBundle\Entity\ChurningActivityLog $churningActivityLog)
  218.     {
  219.         $this->churningActivityLog[] = $churningActivityLog;
  220.         return $this;
  221.     }
  222.     public function removeChurningActivityLog(\Aviatur\FlightBundle\Entity\ChurningActivityLog $churningActivityLog)
  223.     {
  224.         $this->churningActivityLog->removeElement($churningActivityLog);
  225.     }
  226.     public function getChurningActivityLog()
  227.     {
  228.         return $this->churningActivityLog;
  229.     }
  230.     public function addNameWhitelistActivityLog(\Aviatur\GeneralBundle\Entity\NameWhitelistActivityLog $nameWhitelistActivityLog)
  231.     {
  232.         $this->nameWhitelistActivityLog[] = $nameWhitelistActivityLog;
  233.         return $this;
  234.     }
  235.     public function removeNameWhitelistActivityLog(\Aviatur\GeneralBundle\Entity\NameWhitelistActivityLog $nameWhitelistActivityLog)
  236.     {
  237.         $this->nameWhitelistActivityLog->removeElement($nameWhitelistActivityLog);
  238.     }
  239.     public function getNameWhitelistActivityLog()
  240.     {
  241.         return $this->nameWhitelistActivityLog;
  242.     }
  243.     public function addNameBlacklistActivityLog(\Aviatur\GeneralBundle\Entity\NameBlacklistActivityLog $nameBlacklistActivityLog)
  244.     {
  245.         $this->nameBlacklistActivityLog[] = $nameBlacklistActivityLog;
  246.         return $this;
  247.     }
  248.     public function removeNameBlacklistActivityLog(\Aviatur\GeneralBundle\Entity\NameBlacklistActivityLog $nameBlacklistActivityLog)
  249.     {
  250.         $this->nameBlacklistActivityLog->removeElement($nameBlacklistActivityLog);
  251.     }
  252.     public function getNameBlacklistActivityLog()
  253.     {
  254.         return $this->nameBlacklistActivityLog;
  255.     }
  256.     public function addDocumentBlacklistActivityLog(\Aviatur\GeneralBundle\Entity\DocumentBlacklistActivityLog $documentBlacklistActivityLog)
  257.     {
  258.         $this->documentBlacklistActivityLog[] = $documentBlacklistActivityLog;
  259.         return $this;
  260.     }
  261.     public function removeDocumentBlacklistActivityLog(\Aviatur\GeneralBundle\Entity\DocumentBlacklistActivityLog $documentBlacklistActivityLog)
  262.     {
  263.         $this->documentBlacklistActivityLog->removeElement($documentBlacklistActivityLog);
  264.     }
  265.     public function getDocumentBlacklistActivityLog()
  266.     {
  267.         return $this->documentBlacklistActivityLog;
  268.     }
  269.     public function addConfigFlightAgencyActivityLog(\Aviatur\FlightBundle\Entity\ConfigFlightAgencyActivityLog $configFlightAgencyActivityLog)
  270.     {
  271.         $this->configFlightAgencyActivityLog[] = $configFlightAgencyActivityLog;
  272.         return $this;
  273.     }
  274.     public function removeConfigFlightAgencyActivityLog(\Aviatur\FlightBundle\Entity\ConfigFlightAgencyActivityLog $configFlightAgencyActivityLog)
  275.     {
  276.         $this->configFlightAgencyActivityLog->removeElement($configFlightAgencyActivityLog);
  277.     }
  278.     public function getConfigFlightAgencyActivityLog()
  279.     {
  280.         return $this->configFlightAgencyActivityLog;
  281.     }
  282.     public function getAgency(): ?Agency
  283.     {
  284.         return $this->agency;
  285.     }
  286.     public function setAgency(?Agency $agency null): self
  287.     {
  288.         $this->agency $agency;
  289.         return $this;
  290.     }
  291. }