Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace SeerUK\Security\AccountBundle\Entity;
- use Symfony\Component\Security\Core\User\UserInterface;
- use Doctrine\ORM\Mapping as ORM;
- /**
- * SeerUK\Security\AccountBundle\Entity\User
- *
- * @ORM\Table(name="account")
- * @ORM\Entity(repositoryClass="SeerUK\Security\AccountBundle\Entity\UserRepository")
- */
- class User implements UserInterface
- {
- /**
- * @ORM\Column(type="integer")
- * @ORM\Id
- * @ORM\GeneratedValue(strategy="AUTO")
- */
- private $account_id;
- /**
- * @ORM\Column(type="string", length=25, unique=true)
- */
- private $account_name;
- /**
- * @ORM\Column(type="string", length=32)
- */
- private $account_salt;
- /**
- * @ORM\Column(type="string", length=128)
- */
- private $account_password;
- /**
- * @ORM\Column(type="string", length=255, unique=true)
- */
- private $account_email;
- /**
- * @ORM\Column(name="is_active", type="boolean")
- */
- private $isActive;
- public function __construct()
- {
- $this->isActive = true;
- $this->account_salt = ''; //md5(uniqid(null, true));
- }
- /**
- * @inheritDoc
- */
- public function getUsername()
- {
- return $this->account_name;
- }
- /**
- * @inheritDoc
- */
- public function getSalt()
- {
- return $this->account_salt;
- }
- /**
- * @inheritDoc
- */
- public function getPassword()
- {
- return $this->account_password;
- }
- /**
- * @inheritDoc
- */
- public function getRoles()
- {
- return array('ROLE_USER');
- }
- /**
- * @inheritDoc
- */
- public function eraseCredentials()
- {
- }
- /**
- * @inheritDoc
- */
- public function equals(UserInterface $user)
- {
- return $this->account_name === $user->getUsername();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement