daily pastebin goal
15%
SHARE
TWEET

Untitled

a guest Jun 30th, 2018 105 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. namespace FanHelp\Model\Entities;
  4.  
  5. /**
  6.  * @Table(name="user")
  7.  * @Entity(repositoryClass="FanHelp\Model\Entities\UserRepository")
  8.  */
  9. class User {
  10.  
  11.     /**
  12.      * @var integer $id
  13.      * @Id @Column(type="integer", name="user_id")
  14.      * @GeneratedValue
  15.      */
  16.     private $id;
  17.  
  18.     /**
  19.      * @var string $name
  20.      * @Column(type="string")
  21.      */
  22.     private $name;
  23.  
  24.     /**
  25.      * @var string $email
  26.      * @Column(type="string", unique=true)
  27.      */
  28.     private $email;
  29.    
  30.     /**
  31.      * @var string $password
  32.      * @Column(type="string")
  33.      */
  34.     private $password;
  35.  
  36.     /**
  37.      * @var string $isCompetitor
  38.      * @Column(type="boolean", name="competitor")
  39.      */
  40.     private $isCompetitor;
  41.    
  42.     /**
  43.      * @var string $isJudge
  44.      * @Column(type="boolean", name="judge")
  45.      */
  46.     private $isJudge;
  47.    
  48.     /**
  49.      * @var string $hometown
  50.      * @Column(type="string")
  51.      */
  52.     private $hometown;
  53.    
  54.     /**
  55.      * @var string $genre
  56.      * @Column(type="string")
  57.      */
  58.     private $genre;
  59.    
  60.     /**
  61.      * @var FacebookUser $facebookUser
  62.      * @OneToOne(targetEntity="FacebookUser", mappedBy="user", cascade={"all"})
  63.      */
  64.     private $facebookUser;
  65.    
  66.     /**
  67.      * @var string $dateCreated
  68.      * @Column(type="datetime", name="date_created")
  69.      */
  70.     private $dateCreated;
  71.    
  72.     /**
  73.      * @var string $dateModified
  74.      * @Column(type="datetime", name="date_modified")
  75.      */
  76.     private $dateModified;
  77.    
  78.     public function __construct()
  79.     {
  80.         $this->dateCreated = new \DateTime();
  81.     }
  82.    
  83.     /**
  84.      * @return integer $id
  85.      */
  86.     public function getId ()
  87.     {
  88.         return $this->id;
  89.     }
  90.  
  91.     /**
  92.      * @return string $name
  93.      */
  94.     public function getName ()
  95.     {
  96.         return $this->name;
  97.     }
  98.  
  99.     /**
  100.      * @return string $email
  101.      */
  102.     public function getEmail ()
  103.     {
  104.         return $this->email;
  105.     }
  106.  
  107.     /**
  108.      * @return string $password
  109.      */
  110.     public function getPassword ()
  111.     {
  112.         return $this->password;
  113.     }
  114.  
  115.     /**
  116.      * @return boolean $isCompetitor
  117.      */
  118.     public function getIsCompetitor ()
  119.     {
  120.         return $this->isCompetitor;
  121.     }
  122.  
  123.     /**
  124.      * @return boolean $isJudge
  125.      */
  126.     public function getIsJudge ()
  127.     {
  128.         return $this->isJudge;
  129.     }
  130.  
  131.     /**
  132.      * @return string $hometown
  133.      */
  134.     public function getHometown ()
  135.     {
  136.         return $this->hometown;
  137.     }
  138.  
  139.     /**
  140.      * @return string $genre
  141.      */
  142.     public function getGenre ()
  143.     {
  144.         return $this->genre;
  145.     }
  146.  
  147.     /**
  148.      * @return FacebookUser $facebookUser
  149.      */
  150.     public function getFacebookUser ()
  151.     {
  152.         if (is_null($this->facebookUser))
  153.         {
  154.             $this->facebookUser = new FacebookUser();
  155.             $this->facebookUser->setUser($this);
  156.         }
  157.         return $this->facebookUser;
  158.     }
  159.  
  160.     /**
  161.      * @return DateTime $dateCreated
  162.      */
  163.     public function getDateCreated ()
  164.     {
  165.         return $this->dateCreated;
  166.     }
  167.  
  168.     /**
  169.      * @return DateTime $dateModified
  170.      */
  171.     public function getDateModified ()
  172.     {
  173.         return $this->dateModified;
  174.     }
  175.  
  176.     /**
  177.      * @param integer $id
  178.      */
  179.     public function setId ($id)
  180.     {
  181.         $this->id = $id;
  182.     }
  183.  
  184.     /**
  185.      * @param string $name
  186.      */
  187.     public function setName ($name)
  188.     {
  189.         $this->name = $name;
  190.     }
  191.  
  192.     /**
  193.      * @param string $email
  194.      */
  195.     public function setEmail ($email)
  196.     {
  197.         $this->email = $email;
  198.     }
  199.  
  200.     /**
  201.      * @param string $password
  202.      */
  203.     public function setPassword ($password, $hash)
  204.     {
  205.         if (empty($hash)) {
  206.             throw new \Exception('Hash required (2nd argument): use $object->setPassword($password, $hash)');
  207.         }
  208.  
  209.         $this->password = hash('SHA256', $hash . $password);
  210.     }
  211.  
  212.     /**
  213.      * @param string $isCompetitor
  214.      */
  215.     public function setIsCompetitor ($isCompetitor)
  216.     {
  217.         $this->isCompetitor = $isCompetitor;
  218.     }
  219.  
  220.     /**
  221.      * @param string $isJudge
  222.      */
  223.     public function setIsJudge ($isJudge)
  224.     {
  225.         $this->isJudge = $isJudge;
  226.     }
  227.  
  228.     /**
  229.      * @param string $hometown
  230.      */
  231.     public function setHometown ($hometown)
  232.     {
  233.         $this->hometown = $hometown;
  234.     }
  235.  
  236.     /**
  237.      * @param string $genre
  238.      */
  239.     public function setGenre ($genre)
  240.     {
  241.         $this->genre = $genre;
  242.     }
  243.  
  244.     /**
  245.      * @param FacebookUser $facebookUser
  246.      */
  247.     public function setFacebookUser (FacebookUser $facebook)
  248.     {
  249.         $this->facebookUser = $facebook;
  250.     }
  251.  
  252.     /**
  253.      * @param string $dateCreated
  254.      */
  255.     public function setDateCreated ($dateCreated)
  256.     {
  257.         $this->dateCreated = $dateCreated;
  258.     }
  259.  
  260.     /**
  261.      * @param string $dateModified
  262.      */
  263.     public function setDateModified ($dateModified)
  264.     {
  265.         $this->dateModified = $dateModified;
  266.     }
  267.  
  268. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top