Skip to content

Instantly share code, notes, and snippets.

@emir
Created April 28, 2018 22:25
Show Gist options
  • Select an option

  • Save emir/ccdb90dd8bd8b0bc5e3107354953f735 to your computer and use it in GitHub Desktop.

Select an option

Save emir/ccdb90dd8bd8b0bc5e3107354953f735 to your computer and use it in GitHub Desktop.
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Security\Core\User\UserInterface;
/**
* @ORM\Table(name="users")
* @ORM\Entity
*/
class User implements UserInterface
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(type="string", length=25, unique=true)
*/
private $username;
/**
* @ORM\Column(type="string", length=500)
*/
private $password;
/**
* @ORM\Column(name="is_active", type="boolean")
*/
private $isActive;
public function __construct($username)
{
$this->isActive = true;
$this->username = $username;
}
public function getUsername()
{
return $this->username;
}
public function getSalt()
{
return null;
}
public function getPassword()
{
return $this->password;
}
public function setPassword($password)
{
$this->password = $password;
}
public function getRoles()
{
return array('ROLE_USER');
}
public function eraseCredentials()
{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment