Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace Acme\UserBundle\Entity;
- use Symfony\Component\Security\Core\User\UserInterface;
- use Doctrine\ORM\Mapping as ORM;
- /**
- * Acme\UserBundle\Entity\User
- */
- class User implements UserInterface
- {
- function save($obj){
- $em = $obj->getDoctrine()->getEntityManager();
- $em->persist($this);
- $em->flush();
- }
- function getRoles(){
- }
- function getSalt(){
- return md5($this->getEmail);
- }
- function getUserName(){
- return $this->getFirstName().' '.$this->getLastName();
- }
- function eraseCredentials(){
- }
- function equals(UserInterface $user){
- return ($user->getEmail() === $this->getEmail()) && ($user->getPassword() === $this->getPassword());
- }
- /**
- * @var integer $id
- */
- private $id;
- /**
- * @var string $first_name
- */
- private $first_name;
- /**
- * @var string $last_name
- */
- private $last_name;
- /**
- * @var string $email
- */
- private $email;
- /**
- * Get id
- *
- * @return integer
- */
- public function getId()
- {
- return $this->id;
- }
- /**
- * Set first_name
- *
- * @param string $firstName
- */
- public function setFirstName($firstName)
- {
- $this->first_name = $firstName;
- }
- /**
- * Get first_name
- *
- * @return string
- */
- public function getFirstName()
- {
- return $this->first_name;
- }
- /**
- * Set last_name
- *
- * @param string $lastName
- */
- public function setLastName($lastName)
- {
- $this->last_name = $lastName;
- }
- /**
- * Get last_name
- *
- * @return string
- */
- public function getLastName()
- {
- return $this->last_name;
- }
- /**
- * Set email
- *
- * @param string $email
- */
- public function setEmail($email)
- {
- $this->email = $email;
- }
- /**
- * Get email
- *
- * @return string
- */
- public function getEmail()
- {
- return $this->email;
- }
- /**
- * @var string $login
- */
- private $login;
- /**
- * @var string $password
- */
- private $password;
- /**
- * Set password
- *
- * @param string $password
- */
- public function setPassword($password)
- {
- $this->password = $password;
- }
- /**
- * Get password
- *
- * @return string
- */
- public function getPassword()
- {
- return $this->password;
- }
- /**
- * @var smallint $role
- */
- private $role;
- /**
- * Set role
- *
- * @param smallint $role
- */
- public function setRole($role)
- {
- $this->role = $role;
- }
- /**
- * Get role
- *
- * @return smallint
- */
- public function getRole()
- {
- return $this->role;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment