Advertisement
Guest User

Untitled

a guest
Aug 11th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.22 KB | None | 0 0
  1. <?php
  2.  
  3. namespace Callcenter\PrivateBundle\Entity;
  4.  
  5. use Symfony\Component\Security\Core\User\UserInterface;
  6. use Callcenter\PrivateBundle\Repository\UserRepository;
  7. ////use Callcenter\PrivateBundle\Entity\Role;
  8. use Doctrine\Common\Collections\ArrayCollection;
  9.  
  10.  
  11. /**
  12.  * Callcenter\PrivateBundle\Entity\GlobalUser
  13.  *
  14.  * @orm:Table(name="global_user")
  15.  * @orm:Entity
  16.  */
  17. class GlobalUser implements UserInterface
  18. {
  19.     /**
  20.      * @var integer $id
  21.      *
  22.      * @orm:Column(name="id", type="integer", nullable=false)
  23.      * @orm:Id
  24.      * @orm:GeneratedValue(strategy="IDENTITY")
  25.      */
  26.     private $id;
  27.  
  28.     /**
  29.      * @var integer $rolesId
  30.      *
  31.      * @orm:Column(name="roles_id", type="integer", nullable=false)
  32.      */
  33.     private $rolesId;
  34.     /**
  35.      * @var string $username
  36.      *
  37.      * @orm:Column(name="username", type="string", length=25, nullable=false)
  38.      */
  39.     private $username;
  40.  
  41.     /**
  42.      * @var string $password
  43.      *
  44.      * @orm:Column(name="password", type="string", length=25, nullable=false)
  45.      */
  46.     private $password;
  47.  
  48.    
  49.  
  50.     /**
  51.      * @var string $type
  52.      *
  53.      * @orm:Column(name="type", type="string", length=5, nullable=false)
  54.      */
  55.     private $type="md5";
  56.  
  57.     /**
  58.      * @var datetime $createdAt
  59.      *
  60.      * @orm:Column(name="created_at", type="datetime", nullable=false)
  61.      */
  62.     private $createdAt;
  63.  
  64.     /**
  65.      * @var datetime $updatedAt
  66.      *
  67.      * @orm:Column(name="updated_at", type="datetime", nullable=false)
  68.      */
  69.     private $updatedAt;
  70.  
  71.     /**
  72.      * @var integer $active
  73.      *
  74.      * @orm:Column(name="active", type="integer", nullable=false)
  75.      */
  76.     private $active;
  77.  
  78.  
  79.  
  80.     /**
  81.      * Get id
  82.      *
  83.      * @return integer $id
  84.      */
  85.     public function getId()
  86.     {
  87.         return $this->id;
  88.     }
  89.  
  90.     /**
  91.      * Get rolesId
  92.      *
  93.      * @return integer $rolesId
  94.      */
  95.     public function getRolesId()
  96.     {
  97.         return $this->rolesId;
  98.     }
  99.     /**
  100.      * Set rolesId
  101.      *
  102.      * @param inetger $rolesId
  103.      */
  104.     public function setRolesId($rolesId)
  105.     {
  106.         $this->rolesId = $rolesId;
  107.     }
  108.  
  109.     /**
  110.      * Set username
  111.      *
  112.      * @param string $username
  113.      */
  114.     public function setUsername($username)
  115.     {
  116.         $this->username = $username;
  117.     }
  118.  
  119.     /**
  120.      * Get username
  121.      *
  122.      * @return string $username
  123.      */
  124.     public function getUsername()
  125.     {
  126.         return $this->username;
  127.     }
  128.  
  129.     /**
  130.      * Set password
  131.      *
  132.      * @param string $password
  133.      */
  134.     public function setPassword($password)
  135.     {
  136.         $this->password = $password;
  137.     }
  138.  
  139.     /**
  140.      * Get password
  141.      *
  142.      * @return string $password
  143.      */
  144.     public function getPassword()
  145.     {
  146.         return $this->password;
  147.     }
  148.  
  149.    
  150.  
  151.     /**
  152.      * Set type
  153.      *
  154.      * @param string $type
  155.      */
  156.     public function setType($type)
  157.     {
  158.         $this->type = $type;
  159.     }
  160.  
  161.     /**
  162.      * Get type
  163.      *
  164.      * @return string $type
  165.      */
  166.     public function getType()
  167.     {
  168.         return $this->type;
  169.     }
  170.  
  171.     /**
  172.      * Set createdAt
  173.      *
  174.      * @param datetime $createdAt
  175.      */
  176.     public function setCreatedAt($createdAt)
  177.     {
  178.         $this->createdAt = $createdAt;
  179.     }
  180.  
  181.     /**
  182.      * Get createdAt
  183.      *
  184.      * @return datetime $createdAt
  185.      */
  186.     public function getCreatedAt()
  187.     {
  188.         return $this->createdAt;
  189.     }
  190.  
  191.     /**
  192.      * Set updatedAt
  193.      *
  194.      * @param datetime $updatedAt
  195.      */
  196.     public function setUpdatedAt($updatedAt)
  197.     {
  198.         $this->updatedAt = $updatedAt;
  199.     }
  200.  
  201.     /**
  202.      * Get updatedAt
  203.      *
  204.      * @return datetime $updatedAt
  205.      */
  206.     public function getUpdatedAt()
  207.     {
  208.         return $this->updatedAt;
  209.     }
  210.  
  211.     /**
  212.      * Set active
  213.      *
  214.      * @param integer $active
  215.      */
  216.     public function setActive($active)
  217.     {
  218.         $this->active = $active;
  219.     }
  220.  
  221.     /**
  222.      * Get active
  223.      *
  224.      * @return integer $active
  225.      */
  226.     public function getActive()
  227.     {
  228.         return $this->active;
  229.     }
  230.     /////-->IMPLEMENTS
  231.        
  232.     /**
  233.      * @var string $salt
  234.      *
  235.      * @orm:Column(name="salt", type="string", length=5, nullable=false)
  236.      */
  237.     private $salt;
  238.  
  239.  
  240.  
  241.  
  242.  
  243.     /**
  244.      * @orm:ManyToOne(targetEntity="Callcenter\PrivateBundle\Entity\Role")
  245.      * @orm:JoinColumn(name="roles_id", referencedColumnName="id")
  246.      */
  247.     protected $roles;
  248.        
  249.     public function getRoles(){
  250.        
  251.         return array("ALVARO");
  252.     }
  253.     /**
  254.      * Get salt
  255.      *
  256.      * @return string $salt
  257.      */
  258.     public function getSalt(){
  259.         return $this->salt;
  260.     }
  261.     /**
  262.      * Set salt
  263.      *
  264.      * @param string $salt
  265.      */
  266.     public function setSalt($salt){
  267.         $this->salt=$salt;
  268.     }
  269.     public function eraseCredentials(){
  270.         return FALSE;
  271.     }
  272.     public function equals(UserInterface $user){
  273.         return md5($this->getUsername()) == md5($user->getUsername());
  274.         //return $this->getUsername() == $user->getUsername();
  275.     }
  276.     public function __construct(){
  277.         echo "JAMON ";
  278.         $this->roles=new ArrayCollection();
  279.     }
  280. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement