138 lines
		
	
	
		
			2.1 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			138 lines
		
	
	
		
			2.1 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
namespace GergelyPolonkai\FrontBundle\Entity;
 | 
						|
 | 
						|
use Doctrine\ORM\Mapping as ORM;
 | 
						|
use Symfony\Component\Security\Core\User\UserInterface;
 | 
						|
 | 
						|
/**
 | 
						|
 * Description of User
 | 
						|
 *
 | 
						|
 * @author polonkai.gergely
 | 
						|
 *
 | 
						|
 * @ORM\Entity
 | 
						|
 * @ORM\Table(name="users")
 | 
						|
 */
 | 
						|
class User implements UserInterface
 | 
						|
{
 | 
						|
    /**
 | 
						|
     * @ORM\Id
 | 
						|
     * @ORM\GeneratedValue(strategy="AUTO")
 | 
						|
     * @ORM\Column(type="integer")
 | 
						|
     */
 | 
						|
    private $id;
 | 
						|
 | 
						|
    /**
 | 
						|
     * @ORM\Column(type="string", length=50, unique=true)
 | 
						|
     */
 | 
						|
    private $username;
 | 
						|
 | 
						|
    /**
 | 
						|
     * @ORM\Column(type="string", length=100)
 | 
						|
     */
 | 
						|
    private $name;
 | 
						|
 | 
						|
    /**
 | 
						|
     * @var string $password
 | 
						|
     *
 | 
						|
     * @ORM\Column(type="string", length=50, nullable=false)
 | 
						|
     */
 | 
						|
    private $password;
 | 
						|
 | 
						|
    public function __toString()
 | 
						|
    {
 | 
						|
        return $this->name . '(' . $this->username . ')';
 | 
						|
    }
 | 
						|
 | 
						|
    public function getSalt()
 | 
						|
    {
 | 
						|
        return $this->password;
 | 
						|
    }
 | 
						|
 | 
						|
    public function eraseCredentials()
 | 
						|
    {
 | 
						|
    }
 | 
						|
 | 
						|
    public function getRoles()
 | 
						|
    {
 | 
						|
        return array('ROLE_ADMIN');
 | 
						|
    }
 | 
						|
 | 
						|
    /**
 | 
						|
     * Get id
 | 
						|
     *
 | 
						|
     * @return integer
 | 
						|
     */
 | 
						|
    public function getId()
 | 
						|
    {
 | 
						|
        return $this->id;
 | 
						|
    }
 | 
						|
 | 
						|
    /**
 | 
						|
     * Set username
 | 
						|
     *
 | 
						|
     * @param  string $username
 | 
						|
     * @return User
 | 
						|
     */
 | 
						|
    public function setUsername($username)
 | 
						|
    {
 | 
						|
        $this->username = $username;
 | 
						|
 | 
						|
        return $this;
 | 
						|
    }
 | 
						|
 | 
						|
    /**
 | 
						|
     * Get username
 | 
						|
     *
 | 
						|
     * @return string
 | 
						|
     */
 | 
						|
    public function getUsername()
 | 
						|
    {
 | 
						|
        return $this->username;
 | 
						|
    }
 | 
						|
 | 
						|
    /**
 | 
						|
     * 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 password
 | 
						|
     *
 | 
						|
     * @param  string $password
 | 
						|
     * @return User
 | 
						|
     */
 | 
						|
    public function setPassword($password)
 | 
						|
    {
 | 
						|
        $this->password = $password;
 | 
						|
 | 
						|
        return $this;
 | 
						|
    }
 | 
						|
 | 
						|
    /**
 | 
						|
     * Get password
 | 
						|
     *
 | 
						|
     * @return string
 | 
						|
     */
 | 
						|
    public function getPassword()
 | 
						|
    {
 | 
						|
        return $this->password;
 | 
						|
    }
 | 
						|
} |