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

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