Skip to content

Instantly share code, notes, and snippets.

@awdng
Created August 14, 2013 08:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save awdng/6229188 to your computer and use it in GitHub Desktop.
Save awdng/6229188 to your computer and use it in GitHub Desktop.
<?php
/**
* This file is part of the Biologica project.
*
* (c) Arne Wieding arne@wieding.com
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Application\Sonata\UserBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use FOS\UserBundle\Model\User as BaseUser;
use FOS\MessageBundle\Model\ParticipantInterface;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use JMS\Serializer\Annotation as JMS;
/**
* User
*
* @ORM\Table(name="fos_user_user")
* @ORM\Entity
* @UniqueEntity("invitation")
* @JMS\ExclusionPolicy("none")
*/
class User extends BaseUser implements ParticipantInterface
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\Column(name="firstname", type="string", length=255, unique=false, nullable=true)
*/
protected $firstname;
/**
* @ORM\Column(name="lastname", type="string", length=255, unique=false, nullable=true)
*/
protected $lastname;
/**
* @ORM\Column(name="date_of_birth", type="datetime", unique=false, nullable=true)
*/
protected $dateOfBirth;
/**
* @ORM\Column(name="gender", type="string", length=1, unique=false, nullable=true)
*/
protected $gender;
/**
* @ORM\Column(name="agb", type="string", length=1, unique=false, nullable=true)
*/
protected $agb;
/**
* @ORM\Column(name="office_name", type="string", length=64, unique=false, nullable=true)
*/
protected $officeName;
/**
* @ORM\Column(name="title", type="string", length=24, unique=false, nullable=true)
*/
protected $title;
/**
* @ORM\Column(name="street_address", type="string", length=255, unique=false, nullable=true)
*/
protected $streetAddress;
/**
* @ORM\Column(name="zip_code", type="string", length=255, unique=false, nullable=true)
*/
protected $zipCode;
/**
* @ORM\Column(name="town", type="string", length=255, unique=false, nullable=true)
*/
protected $town;
/**
* @ORM\Column(name="state_province", type="string", length=255, unique=false, nullable=true)
*/
protected $stateProvince;
/**
* @ORM\Column(name="country", type="string", length=255, unique=false, nullable=true)
*/
protected $country;
/**
* @ORM\Column(name="about_me", type="string", length=255, unique=false, nullable=true)
*/
protected $aboutMe;
/**
* @ORM\OneToMany(targetEntity="Application\Biologica\MainBundle\Entity\WorkspaceUser", mappedBy="user", cascade={"all"}, orphanRemoval=true)
* @JMS\Exclude
*/
private $workspaces;
/**
* @ORM\ManyToOne(targetEntity="Application\Biologica\MainBundle\Entity\Company\Company", inversedBy="employees", cascade={"all"})
* @JMS\Exclude
*/
private $company;
/**
* @ORM\OneToMany(targetEntity="Application\Biologica\MainBundle\Entity\Report\Report", mappedBy="therapist", cascade={"all"}, orphanRemoval=true)
* @JMS\Exclude
*/
private $reports;
/**
* @ORM\OneToMany(targetEntity="Application\Biologica\MainBundle\Entity\Report\ReportType", mappedBy="owner", cascade={"all"}, orphanRemoval=true)
* @JMS\Exclude
*/
private $reportTypes;
/**
* @ORM\OneToOne(targetEntity="Invitation", inversedBy="user")
* @ORM\JoinColumn(referencedColumnName="id")
* @Assert\NotNull(message="Ihr Einladungscode ist falsch")
*/
protected $invitation;
public function __construct()
{
parent::__construct();
$this->workspaces = new ArrayCollection();
$this->reports = new ArrayCollection();
$this->reportTypes = new ArrayCollection();
}
public function setFirstname($firstname)
{
$this->firstname = $firstname;
}
public function getFirstname()
{
return $this->firstname;
}
public function setLastname($lastname)
{
$this->lastname = $lastname;
}
public function getLastname()
{
return $this->lastname;
}
public function getFullname() {
return $this->getFirstname().' '.$this->getLastname();
}
public function setDateOfBirth($dateOfBirth)
{
$this->dateOfBirth = $dateOfBirth;
}
public function getDateOfBirth()
{
return $this->dateOfBirth;
}
public function setGender($gender)
{
$this->gender = $gender;
}
public function getGender()
{
return $this->gender;
}
public function getOfficeName() {
return $this->officeName;
}
public function setOfficeName($office_name) {
$this->officeName = $office_name;
}
/**
* @param mixed $agb
*/
public function setAgb($agb)
{
$this->agb = $agb;
}
/**
* @return mixed
*/
public function getAgb()
{
return $this->agb;
}
public function getTitle() {
return $this->title;
}
public function setTitle($title) {
$this->title = $title;
}
public function getStreetAddress() {
return $this->streetAddress;
}
public function setStreetAddress($street_address) {
$this->streetAddress = $street_address;
}
public function getZipCode() {
return $this->zipCode;
}
public function setZipCode($zip_code) {
$this->zipCode = $zip_code;
}
public function getTown() {
return $this->town;
}
public function setTown($town) {
$this->town = $town;
}
public function getStateProvince() {
return $this->stateProvince;
}
public function setStateProvince($state_province) {
$this->stateProvince = $state_province;
}
public function getCountry() {
return $this->country;
}
public function setCountry($country) {
$this->country = $country;
}
public function getAboutMe() {
return $this->aboutMe;
}
public function setAboutMe($about_me) {
$this->aboutMe = $about_me;
}
public function getWorkspaces()
{
return $this->workspaces;
}
public function addWorkspace($workspaceUser)
{
$this->workspaces[] = $workspaceUser;
}
public function removeWorkspace($workspaceUser)
{
$this->workspaces->removeElement($workspaceUser);
}
public function getReports()
{
return $this->reports;
}
public function addReport($report)
{
$this->reports[] = $report;
}
public function removeReport($report)
{
$this->reports->removeElement($report);
}
public function getReportTypes()
{
return $this->reportTypes;
}
public function addReportType($reportType)
{
$this->reportTypes[] = $reportType;
}
public function removeReportType($reportType)
{
$this->reportsTypes->removeElement($reportType);
}
/**
* @param mixed $company
*/
public function setCompany($company)
{
$this->company = $company;
}
/**
* @return mixed
*/
public function getCompany()
{
return $this->company;
}
/**
* @param mixed $invitedBy
*/
public function setInvitedBy($invitedBy)
{
$this->invitedBy = $invitedBy;
}
/**
* @return mixed
*/
public function getInvitedBy()
{
return $this->invitedBy;
}
public function setInvitation(Invitation $invitation)
{
$this->invitation = $invitation;
}
public function getInvitation()
{
return $this->invitation;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment