<?php
/**
* Created by Mediterranean Develup Solutions.
* User: jorge.defreitas@develup.solutions
* Date: 14/06/2017
* Time: 16:51
*/
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
/**
* User
*
* @ORM\Table(name="users")
* @ORM\Entity(repositoryClass="App\Repository\UserRepository")
* @UniqueEntity("username")
* @UniqueEntity("email")
* @ORM\HasLifecycleCallbacks()
*/
class User implements UserInterface{
/**
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
* @ORM\Column(type="integer")
*
* @Groups({"assistant:read"})
*/
private $id;
/**
* @ORM\Column(name="picture", type="string", length=255, nullable=true)
*
*/
private $picture;
/**
* @ORM\Column(name="username", type="string", length=255, unique=true)
* @Assert\NotBlank()
*
* @Groups({"assistant:read"})
*/
private $username;
/**
* @ORM\Column(name="email", type="string", length=255, unique=true)
* @Assert\NotBlank()
* @Assert\Email()
*
* @Groups({"assistant:read"})
*/
private $email;
/**
* @ORM\Column(name="password", type="string", length=64)
*/
private $password;
/**
* @ORM\Column(name="movil_password", type="string", length=255, nullable=true)
*/
private $movilPassword;
/**
* @ORM\Column(name="pass_gmail", type="string", length=100, nullable=true)
*/
private $passGmail;
/**
* @ORM\Column(name="firm_gmail", type="text", nullable=true)
*/
private $firmGmail;
/**
* @ORM\Column(name="name", type="string", length=255)
* @Assert\NotBlank()
*
* @Groups({"assistant:read"})
*/
private $name;
/**
* @ORM\Column(name="last_name", type="string", length=255)
* @Assert\NotBlank()
*
* @Groups({"assistant:read"})
*/
private $lastname;
/**
* @ORM\Column(name="telephone", type="string", length=255, nullable=true)
*/
private $telephone;
/**
* @ORM\Column(name="mobile", type="string", length=255, nullable=true)
*/
private $mobile;
/**
* @ORM\Column(name="id_office", type="integer", length=11, nullable=true)
*/
private $office;
/**
* @ORM\Column(name="status", type="boolean")
*/
private $status;
/**
* @ORM\Column(name="id_company", type="integer", length=11, nullable=true)
*/
private $company;
/**
* @ORM\Column(name="id_user_rol", type="integer", length=11, nullable=true)
*
*/
private $userrol;
/**
* @ORM\Column(name="id_team", type="integer", length=11, nullable=true)
*/
private $team;
/**
* @ORM\Column(name="team_leader", type="boolean", nullable=true)
*/
private $teamleader;
/**
* @ORM\Column(name="role", type="string", length=50)
*/
private $role;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $accessKey;
/**
* @var string
* @ORM\Column(name="language", type="string", length=11, nullable=true)
*/
private $language;
/**
* @var string
* @ORM\Column(name="color", type="string", length=11, nullable=true)
*/
private $color;
/**
* @ORM\Column(name="vacations", type="integer", length=11, nullable=true)
*/
private $vacations;
/**
* @ORM\Column(name="half_days", type="integer", length=11, nullable=true)
*/
private $halfDays;
/**
* @ORM\Column(name="sidebar", type="boolean", nullable=true)
*/
private $sidebar;
/**
* @var \Datetime
*
* @ORM\Column(name="created_at", type="datetime")
*/
private $createdAt;
/**
* @var \Datetime
*
* @ORM\Column(name="updated_at", type="datetime")
*/
private $updatedAt;
/**
* @ORM\Column(name="description", type="text", nullable=true)
*/
private $description;
/**
* @var string
* @ORM\Column(name="job_title", type="string", length=255, nullable=true)
*/
private $jobTitle;
public function getId()
{
return $this->id;
}
public function setId($id)
{
$this->id = $id;
}
public function getEmail()
{
return $this->email;
}
public function setEmail($email)
{
$this->email = $email;
}
public function getUsername()
{
return $this->username;
}
public function setUsername($username)
{
$this->username = $username;
}
public function getPassword()
{
return $this->password;
}
public function setPassword($password)
{
$this->password = $password;
}
public function getSalt()
{
// The bcrypt algorithm doesn't require a separate salt.
// You *may* need a real salt if you choose a different encoder.
//return null;
}
public function eraseCredentials()
{
}
public function getRole()
{
return $this->role;
}
public function setRole($role = null)
{
$this->role = $role;
}
public function getRoles()
{
return [$this->getRole()];
}
public function getAccessKey()
{
return $this->accessKey;
}
public function setAccessKey($accessKey = null)
{
$this->accessKey = $accessKey;
}
/**
* Set createdAt
*
* @param \Datetime $createdAt
*
* @return User
*/
public function setCreatedAt(\Datetime $createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
/**
* Get createdAt
*
* @return \Datetime
*/
public function getCreatedAt()
{
return $this->createdAt;
}
/**
* Set updatedAt
*
* @param \Datetime $updatedAt
*
* @return User
*/
public function setUpdatedAt(\Datetime $updatedAt)
{
$this->updatedAt = $updatedAt;
return $this;
}
/**
* Get updatedAt
*
* @return \Datetime
*/
public function getUpdatedAt()
{
return $this->updatedAt;
}
/**
* @ORM\PrePersist
*/
public function setCreatedAtValue()
{
$this->createdAt = new \Datetime();
}
/**
* @ORM\PrePersist
* @ORM\PreUpdate
*/
public function setUpdatedAtValue()
{
$this->updatedAt = new \Datetime();
}
/**
* Set picture
*
* @param string $picture
*
* @return User
*/
public function setPicture($picture)
{
$this->picture = $picture;
return $this;
}
/**
* Get picture
*
* @return string
*/
public function getPicture()
{
return $this->picture;
}
/**
* Set name
*
* @param string $name
*
* @return User
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Get name
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Set lastname
*
* @param string $lastname
*
* @return User
*/
public function setLastname($lastname)
{
$this->lastname = $lastname;
return $this;
}
/**
* Get lastname
*
* @return string
*/
public function getLastname()
{
return $this->lastname;
}
/**
* Set telephone
*
* @param string $telephone
*
* @return User
*/
public function setTelephone($telephone)
{
$this->telephone = $telephone;
return $this;
}
/**
* Get telephone
*
* @return string
*/
public function getTelephone()
{
return $this->telephone;
}
/**
* Set mobile
*
* @param string $mobile
*
* @return User
*/
public function setMobile($mobile)
{
$this->mobile = $mobile;
return $this;
}
/**
* Get mobile
*
* @return string
*/
public function getMobile()
{
return $this->mobile;
}
/**
* Set office
*
* @param integer $office
*
* @return User
*/
public function setOffice($office)
{
$this->office = $office;
return $this;
}
/**
* Get office
*
* @return integer
*/
public function getOffice()
{
return $this->office;
}
/**
* Set status
*
* @param boolean $status
*
* @return User
*/
public function setStatus($status)
{
$this->status = $status;
return $this;
}
/**
* Get status
*
* @return boolean
*/
public function getStatus()
{
return $this->status;
}
/**
* Set company
*
* @param integer $company
*
* @return User
*/
public function setCompany($company)
{
$this->company = $company;
return $this;
}
/**
* Get company
*
* @return integer
*/
public function getCompany()
{
return $this->company;
}
/**
* Set userrol
*
* @param integer $userrol
*
* @return User
*/
public function setUserrol($userrol)
{
$this->userrol = $userrol;
return $this;
}
/**
* Get userrol
*
* @return integer
*/
public function getUserrol()
{
return $this->userrol;
}
/**
* Set team
*
* @param integer $team
*
* @return User
*/
public function setTeam($team)
{
$this->team = $team;
return $this;
}
/**
* Get team
*
* @return integer
*/
public function getTeam()
{
return $this->team;
}
/**
* Set teamleader
*
* @param boolean $teamleader
*
* @return User
*/
public function setTeamleader($teamleader)
{
$this->teamleader = $teamleader;
return $this;
}
/**
* Get teamleader
*
* @return boolean
*/
public function getTeamleader()
{
return $this->teamleader;
}
/**
* Set language
*
* @param string $language
*
* @return User
*/
public function setLanguage($language)
{
$this->language = $language;
return $this;
}
/**
* Get language
*
* @return string
*/
public function getLanguage()
{
return $this->language;
}
/**
* Set passGmail
*
* @param string $passGmail
*
* @return User
*/
public function setPassGmail($passGmail)
{
$this->passGmail = $passGmail;
return $this;
}
/**
* Get passGmail
*
* @return string
*/
public function getPassGmail()
{
return $this->passGmail;
}
/**
* Set firmGmail
*
* @param string $firmGmail
*
* @return User
*/
public function setFirmGmail($firmGmail)
{
$this->firmGmail = $firmGmail;
return $this;
}
/**
* Get firmGmail
*
* @return string
*/
public function getFirmGmail()
{
return $this->firmGmail;
}
/**
* Set color
*
* @param string $color
*
* @return User
*/
public function setColor($color)
{
$this->color = $color;
return $this;
}
/**
* Get color
*
* @return string
*/
public function getColor()
{
return $this->color;
}
/**
* Set vacations
*
* @param integer $vacations
*
* @return User
*/
public function setVacations($vacations)
{
$this->vacations = $vacations;
return $this;
}
/**
* Get vacations
*
* @return integer
*/
public function getVacations()
{
return $this->vacations;
}
/**
* Set sidebar
*
* @param boolean $sidebar
*
* @return User
*/
public function setSidebar($sidebar)
{
$this->sidebar = $sidebar;
return $this;
}
/**
* Get sidebar
*
* @return boolean
*/
public function getSidebar()
{
return $this->sidebar;
}
/**
* Set halfDays
*
* @param integer $halfDays
*
* @return User
*/
public function setHalfDays($halfDays)
{
$this->halfDays = $halfDays;
return $this;
}
/**
* Get halfDays
*
* @return integer
*/
public function getHalfDays()
{
return $this->halfDays;
}
/**
* Set description
*
* @param string $description
*
* @return User
*/
public function setDescription($description)
{
$this->description = $description;
return $this;
}
/**
* Get description
*
* @return string
*/
public function getDescription()
{
return $this->description;
}
/**
* Set jobTitle
*
* @param string $jobTitle
*
* @return User
*/
public function setJobTitle($jobTitle)
{
$this->jobTitle = $jobTitle;
return $this;
}
/**
* Get jobTitle
*
* @return string
*/
public function getJobTitle()
{
return $this->jobTitle;
}
public function getFullName() {
return $this->name . " " . $this->lastname;
}
/**
* Set movilPassword
*
* @param string $movilPassword
*
* @return User
*/
public function setMovilPassword($movilPassword)
{
$this->movilPassword = $movilPassword;
return $this;
}
/**
* Get movilPassword
*
* @return string
*/
public function getMovilPassword()
{
return $this->movilPassword;
}
}