<?php
namespace Aviatur\AdminBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Sonata\UserBundle\Entity\BaseUser as BaseUser;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
/**
* @ORM\Table(name="fos_user_user")
* @ORM\Entity
*/
class AdminUser extends BaseUser
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer", nullable=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
protected $id;
/**
* @var string
*
* @ORM\Column(name="firstname", type="string", length=64, nullable=true)
*/
protected $firstname;
/**
* @var string
*
* @ORM\Column(name="lastname", type="string", length=64, nullable=true)
*/
protected $lastname;
/**
* @var int|null
*
* @ORM\Column(name="locked", type="integer", nullable=true, options={"default" : 0 })
*/
protected $locked = 0;
/**
* @var int|null
*
* @ORM\Column(name="expired", type="integer", nullable=true, options={"default" : 0 })
*/
protected $expired = 0;
/**
* @var int|null
*
* @ORM\Column(name="credentials_expired", type="integer", nullable=true, options={"default" : 0 })
*/
protected $credentialsExpired = 0;
// --- Original AdminUser Relations ---
/** * @var Collection
*/
private $activityLog;
/** * @var Collection
*/
private $content;
/**
* @ORM\OneToMany(targetEntity="Aviatur\GeneralBundle\Entity\UserAgency", mappedBy="user", cascade={"persist", "remove"})
*/
private $userAgency;
protected $customer;
// --- Relations Merged from FosUserUser ---
/**
* @ORM\OneToMany(targetEntity="Aviatur\FlightBundle\Entity\ChurningActivityLog", mappedBy="order", cascade={"all"})
*/
private $churningActivityLog;
/**
* @ORM\OneToMany(targetEntity="Aviatur\GeneralBundle\Entity\NameWhitelistActivityLog", mappedBy="fosUserUser", cascade={"all"})
*/
private $nameWhitelistActivityLog;
/**
* @ORM\OneToMany(targetEntity="Aviatur\GeneralBundle\Entity\NameBlacklistActivityLog", mappedBy="fosUserUser", cascade={"all"})
*/
private $nameBlacklistActivityLog;
/**
* @ORM\OneToMany(targetEntity="Aviatur\GeneralBundle\Entity\DocumentBlacklistActivityLog", mappedBy="fosUserUser", cascade={"all"})
*/
private $documentBlacklistActivityLog;
/**
* @ORM\OneToMany(targetEntity="Aviatur\FlightBundle\Entity\ConfigFlightAgencyActivityLog", mappedBy="fosUserUser", cascade={"all"})
*/
private $configFlightAgencyActivityLog;
/**
* Constructor.
*/
public function __construct()
{
// Only call parent constructor if it actually exists
if (method_exists(get_parent_class($this), '__construct')) {
parent::__construct();
}
// Collections from original AdminUser
$this->activityLog = new ArrayCollection();
$this->content = new ArrayCollection();
$this->userAgency = new ArrayCollection();
// Collections merged from FosUserUser
$this->churningActivityLog = new ArrayCollection();
$this->nameWhitelistActivityLog = new ArrayCollection();
$this->nameBlacklistActivityLog = new ArrayCollection();
$this->documentBlacklistActivityLog = new ArrayCollection();
$this->configFlightAgencyActivityLog = new ArrayCollection();
}
/**
* Get id.
*
* @return int $id
*/
public function getId()
{
return $this->id;
}
/**
* Set firstname.
*
* @param string $firstname
*
* @return $this
*/
public function setFirstname($firstname)
{
$this->firstname = $firstname;
return $this;
}
/**
* Get firstname.
*
* @return string
*/
public function getFirstname()
{
return $this->firstname;
}
/**
* Set lastname.
*
* @param string $lastname
*
* @return $this
*/
public function setLastname($lastname)
{
$this->lastname = $lastname;
return $this;
}
/**
* Get lastname.
*
* @return string
*/
public function getLastname()
{
return $this->lastname;
}
// --- Methods from original AdminUser ---
public function addActivityLog(\Aviatur\GeneralBundle\Entity\ActivityLog $activityLog)
{
$this->activityLog[] = $activityLog;
return $this;
}
public function removeActivityLog(\Aviatur\GeneralBundle\Entity\ActivityLog $activityLog)
{
$this->activityLog->removeElement($activityLog);
}
public function getActivityLog()
{
return $this->activityLog;
}
public function addContent(\Aviatur\ContentBundle\Entity\Content $content)
{
$this->content[] = $content;
return $this;
}
public function removeContent(\Aviatur\ContentBundle\Entity\Content $content)
{
$this->content->removeElement($content);
}
public function getContent()
{
return $this->content;
}
public function addUserAgency(\Aviatur\GeneralBundle\Entity\UserAgency $userAgency)
{
$this->userAgency[] = $userAgency;
return $this;
}
/**
* Note: The type hint in your original file for remove was Markup,
* but logically it should be UserAgency. Check this if you get errors.
*/
public function removeUserAgency($userAgency)
{
$this->userAgency->removeElement($userAgency);
}
public function getUserAgency()
{
return $this->userAgency;
}
public function setCustomer(\Aviatur\CustomerBundle\Entity\Customer $customer = null)
{
$this->customer = $customer;
return $this;
}
public function getCustomer()
{
return $this->customer;
}
// --- Methods Merged from FosUserUser ---
public function addChurningActivityLog(\Aviatur\FlightBundle\Entity\ChurningActivityLog $churningActivityLog)
{
$this->churningActivityLog[] = $churningActivityLog;
return $this;
}
public function removeChurningActivityLog(\Aviatur\FlightBundle\Entity\ChurningActivityLog $churningActivityLog)
{
$this->churningActivityLog->removeElement($churningActivityLog);
}
public function getChurningActivityLog()
{
return $this->churningActivityLog;
}
public function addNameWhitelistActivityLog(\Aviatur\GeneralBundle\Entity\NameWhitelistActivityLog $nameWhitelistActivityLog)
{
$this->nameWhitelistActivityLog[] = $nameWhitelistActivityLog;
return $this;
}
public function removeNameWhitelistActivityLog(\Aviatur\GeneralBundle\Entity\NameWhitelistActivityLog $nameWhitelistActivityLog)
{
$this->nameWhitelistActivityLog->removeElement($nameWhitelistActivityLog);
}
public function getNameWhitelistActivityLog()
{
return $this->nameWhitelistActivityLog;
}
public function addNameBlacklistActivityLog(\Aviatur\GeneralBundle\Entity\NameBlacklistActivityLog $nameBlacklistActivityLog)
{
$this->nameBlacklistActivityLog[] = $nameBlacklistActivityLog;
return $this;
}
public function removeNameBlacklistActivityLog(\Aviatur\GeneralBundle\Entity\NameBlacklistActivityLog $nameBlacklistActivityLog)
{
$this->nameBlacklistActivityLog->removeElement($nameBlacklistActivityLog);
}
public function getNameBlacklistActivityLog()
{
return $this->nameBlacklistActivityLog;
}
public function addDocumentBlacklistActivityLog(\Aviatur\GeneralBundle\Entity\DocumentBlacklistActivityLog $documentBlacklistActivityLog)
{
$this->documentBlacklistActivityLog[] = $documentBlacklistActivityLog;
return $this;
}
public function removeDocumentBlacklistActivityLog(\Aviatur\GeneralBundle\Entity\DocumentBlacklistActivityLog $documentBlacklistActivityLog)
{
$this->documentBlacklistActivityLog->removeElement($documentBlacklistActivityLog);
}
public function getDocumentBlacklistActivityLog()
{
return $this->documentBlacklistActivityLog;
}
public function addConfigFlightAgencyActivityLog(\Aviatur\FlightBundle\Entity\ConfigFlightAgencyActivityLog $configFlightAgencyActivityLog)
{
$this->configFlightAgencyActivityLog[] = $configFlightAgencyActivityLog;
return $this;
}
public function removeConfigFlightAgencyActivityLog(\Aviatur\FlightBundle\Entity\ConfigFlightAgencyActivityLog $configFlightAgencyActivityLog)
{
$this->configFlightAgencyActivityLog->removeElement($configFlightAgencyActivityLog);
}
public function getConfigFlightAgencyActivityLog()
{
return $this->configFlightAgencyActivityLog;
}
}