Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace Callcenter\PrivateBundle\Entity;
- use Symfony\Component\Security\Core\User\UserInterface;
- use Callcenter\PrivateBundle\Repository\UserRepository;
- ////use Callcenter\PrivateBundle\Entity\Role;
- use Doctrine\Common\Collections\ArrayCollection;
- /**
- * Callcenter\PrivateBundle\Entity\GlobalUser
- *
- * @orm:Table(name="global_user")
- * @orm:Entity
- */
- class GlobalUser implements UserInterface
- {
- /**
- * @var integer $id
- *
- * @orm:Column(name="id", type="integer", nullable=false)
- * @orm:Id
- * @orm:GeneratedValue(strategy="IDENTITY")
- */
- private $id;
- /**
- * @var integer $rolesId
- *
- * @orm:Column(name="roles_id", type="integer", nullable=false)
- */
- private $rolesId;
- /**
- * @var string $username
- *
- * @orm:Column(name="username", type="string", length=25, nullable=false)
- */
- private $username;
- /**
- * @var string $password
- *
- * @orm:Column(name="password", type="string", length=25, nullable=false)
- */
- private $password;
- /**
- * @var string $type
- *
- * @orm:Column(name="type", type="string", length=5, nullable=false)
- */
- private $type="md5";
- /**
- * @var datetime $createdAt
- *
- * @orm:Column(name="created_at", type="datetime", nullable=false)
- */
- private $createdAt;
- /**
- * @var datetime $updatedAt
- *
- * @orm:Column(name="updated_at", type="datetime", nullable=false)
- */
- private $updatedAt;
- /**
- * @var integer $active
- *
- * @orm:Column(name="active", type="integer", nullable=false)
- */
- private $active;
- /**
- * Get id
- *
- * @return integer $id
- */
- public function getId()
- {
- return $this->id;
- }
- /**
- * Get rolesId
- *
- * @return integer $rolesId
- */
- public function getRolesId()
- {
- return $this->rolesId;
- }
- /**
- * Set rolesId
- *
- * @param inetger $rolesId
- */
- public function setRolesId($rolesId)
- {
- $this->rolesId = $rolesId;
- }
- /**
- * Set username
- *
- * @param string $username
- */
- public function setUsername($username)
- {
- $this->username = $username;
- }
- /**
- * Get username
- *
- * @return string $username
- */
- public function getUsername()
- {
- return $this->username;
- }
- /**
- * Set password
- *
- * @param string $password
- */
- public function setPassword($password)
- {
- $this->password = $password;
- }
- /**
- * Get password
- *
- * @return string $password
- */
- public function getPassword()
- {
- return $this->password;
- }
- /**
- * Set type
- *
- * @param string $type
- */
- public function setType($type)
- {
- $this->type = $type;
- }
- /**
- * Get type
- *
- * @return string $type
- */
- public function getType()
- {
- return $this->type;
- }
- /**
- * Set createdAt
- *
- * @param datetime $createdAt
- */
- public function setCreatedAt($createdAt)
- {
- $this->createdAt = $createdAt;
- }
- /**
- * Get createdAt
- *
- * @return datetime $createdAt
- */
- public function getCreatedAt()
- {
- return $this->createdAt;
- }
- /**
- * Set updatedAt
- *
- * @param datetime $updatedAt
- */
- public function setUpdatedAt($updatedAt)
- {
- $this->updatedAt = $updatedAt;
- }
- /**
- * Get updatedAt
- *
- * @return datetime $updatedAt
- */
- public function getUpdatedAt()
- {
- return $this->updatedAt;
- }
- /**
- * Set active
- *
- * @param integer $active
- */
- public function setActive($active)
- {
- $this->active = $active;
- }
- /**
- * Get active
- *
- * @return integer $active
- */
- public function getActive()
- {
- return $this->active;
- }
- /////-->IMPLEMENTS
- /**
- * @var string $salt
- *
- * @orm:Column(name="salt", type="string", length=5, nullable=false)
- */
- private $salt;
- /**
- * @orm:ManyToOne(targetEntity="Callcenter\PrivateBundle\Entity\Role")
- * @orm:JoinColumn(name="roles_id", referencedColumnName="id")
- */
- protected $roles;
- public function getRoles(){
- return array("ALVARO");
- }
- /**
- * Get salt
- *
- * @return string $salt
- */
- public function getSalt(){
- return $this->salt;
- }
- /**
- * Set salt
- *
- * @param string $salt
- */
- public function setSalt($salt){
- $this->salt=$salt;
- }
- public function eraseCredentials(){
- return FALSE;
- }
- public function equals(UserInterface $user){
- return md5($this->getUsername()) == md5($user->getUsername());
- //return $this->getUsername() == $user->getUsername();
- }
- public function __construct(){
- echo "JAMON ";
- $this->roles=new ArrayCollection();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement