Skip to content

Instantly share code, notes, and snippets.

@pboethig
Created July 10, 2016 11:30
Show Gist options
  • Save pboethig/39aa1c759ff9250d57022fde44afce1e to your computer and use it in GitHub Desktop.
Save pboethig/39aa1c759ff9250d57022fde44afce1e to your computer and use it in GitHub Desktop.
<?php
namespace BlogBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Users
*
* @ORM\Table(name="users")
* @ORM\Entity
*/
class Users implements \Symfony\Component\Security\Core\User\UserInterface
{
/**
* @var string
*
* @ORM\Column(name="firstname", type="string", length=255, nullable=true)
*/
private $firstname;
/**
* @var string
*
* @ORM\Column(name="lastame", type="string", length=255, nullable=true)
*/
private $lastame;
/**
* @var string
*
* @ORM\Column(name="username", type="string", length=50, nullable=true)
*/
private $username;
/**
* @var string
*
* @ORM\Column(name="email", type="string", length=255, nullable=true)
*/
private $email;
/**
* @var string
*
* @ORM\Column(name="password", type="string", length=255, nullable=true)
*/
private $password;
/**
* @var \DateTime
*
* @ORM\Column(name="created", type="datetime", nullable=true)
*/
private $created;
/**
* @var \DateTime
*
* @ORM\Column(name="updated", type="datetime", nullable=true)
*/
private $updated;
/**
* @var integer
*
* @ORM\Column(name="isDeleted", type="integer", nullable=true)
*/
private $isdeleted;
/**
* @var integer
*
* @ORM\Column(name="isActive", type="integer", nullable=true)
*/
private $isactive;
/**
* @var integer
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
/**
* Set firstname
*
* @param string $firstname
*
* @return Users
*/
public function setFirstname($firstname)
{
$this->firstname = $firstname;
return $this;
}
/**
* Get firstname
*
* @return string
*/
public function getFirstname()
{
return $this->firstname;
}
/**
* Set lastame
*
* @param string $lastame
*
* @return Users
*/
public function setLastame($lastame)
{
$this->lastame = $lastame;
return $this;
}
/**
* Get lastame
*
* @return string
*/
public function getLastame()
{
return $this->lastame;
}
/**
* Set username
*
* @param string $username
*
* @return Users
*/
public function setUsername($username)
{
$this->username = $username;
return $this;
}
/**
* Get username
*
* @return string
*/
public function getUsername()
{
return $this->username;
}
/**
* Set email
*
* @param string $email
*
* @return Users
*/
public function setEmail($email)
{
$this->email = $email;
return $this;
}
/**
* Get email
*
* @return string
*/
public function getEmail()
{
return $this->email;
}
/**
* Set password
*
* @param string $password
*
* @return Users
*/
public function setPassword($password)
{
$this->password = $password;
return $this;
}
/**
* Get password
*
* @return string
*/
public function getPassword()
{
return $this->password;
}
/**
* Set created
*
* @param \DateTime $created
*
* @return Users
*/
public function setCreated($created)
{
$this->created = $created;
return $this;
}
/**
* Get created
*
* @return \DateTime
*/
public function getCreated()
{
return $this->created;
}
/**
* Set updated
*
* @param \DateTime $updated
*
* @return Users
*/
public function setUpdated($updated)
{
$this->updated = $updated;
return $this;
}
/**
* Get updated
*
* @return \DateTime
*/
public function getUpdated()
{
return $this->updated;
}
/**
* Set isdeleted
*
* @param integer $isdeleted
*
* @return Users
*/
public function setIsdeleted($isdeleted)
{
$this->isdeleted = $isdeleted;
return $this;
}
/**
* Get isdeleted
*
* @return integer
*/
public function getIsdeleted()
{
return $this->isdeleted;
}
/**
* Set isactive
*
* @param integer $isactive
*
* @return Users
*/
public function setIsactive($isactive)
{
$this->isactive = $isactive;
return $this;
}
/**
* Get isactive
*
* @return integer
*/
public function getIsactive()
{
return $this->isactive;
}
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
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;
}
/**
* Returns the roles granted to the user.
*
* <code>
* public function getRoles()
* {
* return array('ROLE_USER');
* }
* </code>
*
* Alternatively, the roles might be stored on a ``roles`` property,
* and populated in any number of different ways when the user object
* is created.
*
* @return (Role|string)[] The user roles
*/
public function getRoles()
{
return array('ROLE_USER');
}
/**
* Removes sensitive data from the user.
*
* This is important if, at any given point, sensitive information like
* the plain-text password is stored on this object.
*/
public function eraseCredentials()
{
// TODO: Implement eraseCredentials() method.
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment