Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace OCI\UserBundle\Entity;
- use Symfony\Component\Security\Core\User\UserInterface;
- use Symfony\Component\Security\Core\User\AdvancedUserInterface;
- /**
- * @orm:Entity
- */
- class User implements AdvancedUserInterface
- {
- /**
- * @orm:ID
- * @orm:Column(type="integer")
- * @orm:GeneratedValue(strategy="AUTO")
- */
- protected $ID = null;
- /**
- * @orm:Column(type="string", length="255", unique = true, nullable = false)
- */
- protected $username;
- /**
- * @orm:Column(type="string", length="255", nullable = false)
- */
- protected $password;
- /**
- * @orm:Column(type="string", length="255", nullable = true)
- */
- protected $token;
- /**
- * @orm:Column(type="string", length="255", nullable = true)
- */
- protected $name;
- /**
- * @orm:Column(type="string", length="255", nullable = false)
- */
- protected $lastname;
- /**
- * @orm:Column(type="string", length="255", nullable = true)
- */
- protected $phone;
- /**
- * @orm:Column(type="string", length="1", nullable = false)
- * @orm:DefaultValue ("m")
- */
- protected $sex;
- /**
- * @orm:Column(type="string", length="255", nullable = false)
- */
- protected $email;
- /**
- * @orm:Column(type="string", length="255", nullable = true)
- */
- protected $department;
- /**
- * @orm:Column(type="string", length="255", nullable = true)
- */
- protected $position;
- /**
- * @orm:Column(type="string", length="255", nullable = false)
- * @orm:DefaultValue ("ROLE_CLIENT")
- */
- protected $rights;
- /**
- * @orm:Column(type="smallint", length="1", nullable = false)
- * @orm:DefaultValue ("0")
- */
- protected $visitor;
- /**
- * @orm:Column(type="smallint", length="1", nullable = false)
- * @orm:DefaultValue ("0")
- */
- protected $loggedin;
- /**
- * @orm:Column(type="smallint", length="1", nullable = false)
- * @orm:DefaultValue ("1")
- */
- protected $active;
- /**
- * @orm:Column(type="integer", nullable = true)
- */
- protected $lastlogin;
- /**
- * @orm:Column(type="string", length="255", nullable = false)
- */
- protected $registerDate;
- /**
- * @ManyToMany(targetEntity="User", mappedBy="employees")
- */
- protected $companies;
- /**
- * @orm:oneToMany(targetEntity="SystemInformation", mappedBy="user", cascade={"persist", "merge"})
- */
- protected $systemInformations;
- /**
- * @orm:oneToMany(targetEntity="OCI\FileBundle\Entity\File", mappedBy="user", cascade={"persist", "merge"})
- */
- protected $upFiles;
- /**
- * @orm:oneToMany(targetEntity="OCI\FileBundle\Entity\UserDownload", mappedBy="user", cascade={"all"})
- */
- protected $downFiles;
- /**
- * @orm:oneToMany(targetEntity="OCI\FileBundle\Entity\UserFolderRights", mappedBy="user", cascade={"all"})
- */
- protected $folderRights;
- /**
- * @orm:oneToMany(targetEntity="OCI\ProjectBundle\Entity\ProjectMember", mappedBy="user", cascade={"all"})
- */
- protected $projects;
- /**
- * @orm:oneToMany(targetEntity="OCI\ProjectBundle\Entity\Note", mappedBy="user", cascade={"all"})
- */
- protected $notes;
- /**
- * @orm:oneToMany(targetEntity="OCI\ProjectBundle\Entity\User2Appointment", mappedBy="user", cascade={"all"})
- */
- protected $appointments;
- public function __construct()
- {
- $this->companies = new \Doctrine\Common\Collections\ArrayCollection();
- $this->systemInformations = new \Doctrine\Common\Collections\ArrayCollection();
- $this->upFiles = new \Doctrine\Common\Collections\ArrayCollection();
- $this->downFiles = new \Doctrine\Common\Collections\ArrayCollection();
- $this->folderRights = new \Doctrine\Common\Collections\ArrayCollection();
- $this->projects = new \Doctrine\Common\Collections\ArrayCollection();
- $this->notes = new \Doctrine\Common\Collections\ArrayCollection();
- $this->appointments = new \Doctrine\Common\Collections\ArrayCollection();
- }
- /**
- * Get ID
- *
- * @return integer $iD
- */
- public function getID()
- {
- return $this->ID;
- }
- /**
- * Set username
- *
- * @param string $username
- */
- public function setUsername($username)
- {
- $this->username = $username;
- }
- /**
- * Get username
- *
- * @return string $email
- */
- public function getUsername()
- {
- return $this->email;
- }
- /**
- * Get username
- *
- * @return string $username
- */
- public function getUname()
- {
- return $this->username;
- }
- /**
- * Set password
- *
- * @param string $password
- */
- public function setPassword($password)
- {
- $this->password = $password;
- }
- /**
- * Get password
- *
- * @return string $password
- */
- public function getPassword()
- {
- return $this->password;
- }
- /**
- * Set token
- *
- * @param string $token
- */
- public function setToken($token)
- {
- $this->token = $token;
- }
- /**
- * Get token
- *
- * @return string $token
- */
- public function getToken()
- {
- return $this->token;
- }
- /**
- * Set name
- *
- * @param string $name
- */
- public function setName($name)
- {
- $this->name = $name;
- }
- /**
- * Get name
- *
- * @return string $name
- */
- public function getName()
- {
- return $this->name;
- }
- /**
- * Set lastname
- *
- * @param string $lastname
- */
- public function setLastname($lastname)
- {
- $this->lastname = $lastname;
- }
- /**
- * Get lastname
- *
- * @return string $lastname
- */
- public function getLastname()
- {
- return $this->lastname;
- }
- /**
- * Set phone
- *
- * @param string $phone
- */
- public function setPhone($phone)
- {
- $this->phone = $phone;
- }
- /**
- * Get phone
- *
- * @return string $phone
- */
- public function getPhone()
- {
- return $this->phone;
- }
- /**
- * Set sex
- *
- * @param string $sex
- */
- public function setSex($sex)
- {
- $this->sex = $sex;
- }
- /**
- * Get sex
- *
- * @return string $sex
- */
- public function getSex()
- {
- return $this->sex;
- }
- /**
- * Set email
- *
- * @param string $email
- */
- public function setEmail($email)
- {
- $this->email = $email;
- }
- /**
- * Get email
- *
- * @return string $email
- */
- public function getEmail()
- {
- return $this->email;
- }
- /**
- * Set department
- *
- * @param string $department
- */
- public function setDepartment($department)
- {
- $this->department = $department;
- }
- /**
- * Get department
- *
- * @return string $department
- */
- public function getDepartment()
- {
- return $this->department;
- }
- /**
- * Set position
- *
- * @param string $position
- */
- public function setPosition($position)
- {
- $this->position = $position;
- }
- /**
- * Get position
- *
- * @return string $position
- */
- public function getPosition()
- {
- return $this->position;
- }
- /**
- * Set rights
- *
- * @param string $rights
- */
- public function setRights($rights)
- {
- $this->rights = $rights;
- }
- /**
- * Get rights
- *
- * @return string $rights
- */
- public function getRights()
- {
- return $this->rights;
- }
- /**
- * Set visitor
- *
- * @param smallint $visitor
- */
- public function setVisitor($visitor)
- {
- $this->visitor = $visitor;
- }
- /**
- * Get visitor
- *
- * @return smallint $visitor
- */
- public function getVisitor()
- {
- return $this->visitor;
- }
- /**
- * Set loggedin
- *
- * @param smallint $loggedin
- */
- public function setLoggedin($loggedin)
- {
- $this->loggedin = $loggedin;
- }
- /**
- * Get loggedin
- *
- * @return smallint $loggedin
- */
- public function getLoggedin()
- {
- return $this->loggedin;
- }
- /**
- * Set active
- *
- * @param smallint $active
- */
- public function setActive($active)
- {
- $this->active = $active;
- }
- /**
- * Get active
- *
- * @return smallint $active
- */
- public function getActive()
- {
- return $this->active;
- }
- /**
- * Set lastlogin
- *
- * @param integer $lastlogin
- */
- public function setLastlogin($lastlogin)
- {
- $this->lastlogin = $lastlogin;
- }
- /**
- * Get lastlogin
- *
- * @return integer $lastlogin
- */
- public function getLastlogin()
- {
- return $this->lastlogin;
- }
- /**
- * Set registerDate
- *
- * @param string $registerDate
- */
- public function setRegisterDate($registerDate)
- {
- $this->registerDate = $registerDate;
- }
- /**
- * Get registerDate
- *
- * @return string $registerDate
- */
- public function getRegisterDate()
- {
- return $this->registerDate;
- }
- /**
- * Add companies
- *
- * @param OCI\UserBundle\Entity\Employee $companies
- */
- public function addCompanies(\OCI\UserBundle\Entity\Employee $companies)
- {
- $this->companies[] = $companies;
- }
- /**
- * Get companies
- *
- * @return Doctrine\Common\Collections\Collection $companies
- */
- public function getCompanies()
- {
- return $this->companies;
- }
- /**
- * Add systemInformations
- *
- * @param OCI\UserBundle\Entity\SystemInformation $systemInformations
- */
- public function addSystemInformations(\OCI\UserBundle\Entity\SystemInformation $systemInformations)
- {
- $this->systemInformations[] = $systemInformations;
- }
- /**
- * Get systemInformations
- *
- * @return Doctrine\Common\Collections\Collection $systemInformations
- */
- public function getSystemInformations()
- {
- return $this->systemInformations;
- }
- /**
- * Add upFiles
- *
- * @param OCI\FileBundle\Entity\File $upFiles
- */
- public function addUpFiles(\OCI\FileBundle\Entity\File $upFiles)
- {
- $this->upFiles[] = $upFiles;
- }
- /**
- * Get upFiles
- *
- * @return Doctrine\Common\Collections\Collection $upFiles
- */
- public function getUpFiles()
- {
- return $this->upFiles;
- }
- /**
- * Add downFiles
- *
- * @param OCI\FileBundle\Entity\UserDownload $downFiles
- */
- public function addDownFiles(\OCI\FileBundle\Entity\UserDownload $downFiles)
- {
- $this->downFiles[] = $downFiles;
- }
- /**
- * Get downFiles
- *
- * @return Doctrine\Common\Collections\Collection $downFiles
- */
- public function getDownFiles()
- {
- return $this->downFiles;
- }
- /**
- * Add folderRights
- *
- * @param OCI\FileBundle\Entity\UserFolderRights $folderRights
- */
- public function addFolderRights(\OCI\FileBundle\Entity\UserFolderRights $folderRights)
- {
- $this->folderRights[] = $folderRights;
- }
- /**
- * Get folderRights
- *
- * @return Doctrine\Common\Collections\Collection $folderRights
- */
- public function getFolderRights()
- {
- return $this->folderRights;
- }
- /**
- * Add projects
- *
- * @param OCI\ProjectBundle\Entity\ProjectMember $projects
- */
- public function addProjects(\OCI\ProjectBundle\Entity\ProjectMember $projects)
- {
- $this->projects[] = $projects;
- }
- /**
- * Get projects
- *
- * @return Doctrine\Common\Collections\Collection $projects
- */
- public function getProjects()
- {
- return $this->projects;
- }
- /**
- * Add notes
- *
- * @param OCI\ProjectBundle\Entity\Note $notes
- */
- public function addNotes(\OCI\ProjectBundle\Entity\Note $notes)
- {
- $this->notes[] = $notes;
- }
- /**
- * Get notes
- *
- * @return Doctrine\Common\Collections\Collection $notes
- */
- public function getNotes()
- {
- return $this->notes;
- }
- /**
- * Add appointments
- *
- * @param OCI\ProjectBundle\Entity\User2Appointment $appointments
- */
- public function addAppointments(\OCI\ProjectBundle\Entity\User2Appointment $appointments)
- {
- $this->appointments[] = $appointments;
- }
- /**
- * Get appointments
- *
- * @return Doctrine\Common\Collections\Collection $appointments
- */
- public function getAppointments()
- {
- return $this->appointments;
- }
- /*
- * ACCOUNT INTERFACE
- */
- public function getSalt()
- {
- //return $this->getID();
- return '';
- }
- public function eraseCredentials()
- {
- }
- public function getRoles()
- {
- return array($this->getRights());
- }
- public function equals(UserInterface $username)
- {
- return true;
- }
- public function isAccountNonExpired()
- {
- return true;
- }
- public function isAccountNonLocked()
- {
- return true;
- }
- public function isCredentialsNonExpired()
- {
- return true;
- }
- public function isEnabled()
- {
- return $this->getActive();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement