Guest User

Untitled

a guest
Apr 11th, 2017
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.76 KB | None | 0 0
  1. <?php
  2.     namespace App\Model\Entities;
  3.    
  4.     use Doctrine\Common\Collections\ArrayCollection;
  5.     use Doctrine\ORM\Mapping AS ORM;
  6.     use Kdyby\Doctrine\Entities\BaseEntity;
  7.    
  8.    
  9.     /**
  10.      * @ORM\Entity
  11.      */
  12.    
  13.     class Addressbook extends BaseEntity
  14.     {
  15.         /**
  16.          * @ORM\Id
  17.          * @ORM\Column(type="integer")
  18.          * @ORM\GeneratedValue
  19.          */
  20.         private $id;
  21.    
  22.         /**
  23.          * @ORM\ManyToOne(targetEntity="User")
  24.          * @ORM\JoinColumn(name="user_id", nullable=true, referencedColumnName="id", onDelete="RESTRICT")
  25.          */
  26.         protected $user;
  27.        
  28.         /**
  29.          * @ORM\Column(type="string", nullable=false)
  30.          * @var string
  31.          */
  32.         private $subject;
  33.        
  34.        
  35.         public function __construct()
  36.         {
  37.             $this->user = new User();
  38.         }
  39.        
  40.        
  41.        
  42.         public function getSubject() {
  43.             return $this->subject;
  44.         }
  45.        
  46.         public function setSubject($subject) {
  47.             $this->subject = $subject;
  48.         }
  49.     }
  50.     ?>
  51.  
  52. <?php
  53.  
  54. namespace App\Model\Entities;
  55.  
  56. use Doctrine\ORM\Mapping AS ORM;
  57. use Doctrine\Common\Collections\ArrayCollection;
  58. use Kdyby\Doctrine\Entities\BaseEntity;
  59. use Kdyby\Doctrine\Entities\Attributes\Identifier;
  60. use Nette\Security\Passwords;
  61.  
  62.  
  63. /**
  64.  * @ORM\Entity
  65.  * @ORM\Table(name="users")
  66.  */
  67.  
  68. class User extends BaseEntity
  69. {
  70.     /**
  71.      * @ORM\Id
  72.      * @ORM\Column(type="integer")
  73.      * @ORM\GeneratedValue
  74.      */
  75.     private $id;
  76.  
  77.     /**
  78.      * @ORM\Column(type="string", nullable=false)
  79.      * @var string
  80.      */
  81.     private $username;
  82.  
  83.     /**
  84.      * @ORM\Column(type="string", nullable=true)
  85.      * @var string
  86.      */
  87.     private $password;
  88.  
  89.     /**
  90.      * @ORM\ManyToOne(targetEntity="Addressbook")
  91.      * @ORM\JoinColumn(name="address_id", nullable=true, referencedColumnName="id", onDelete="RESTRICT")
  92.      */
  93.     protected $address;
  94.    
  95.     public function __construct()
  96.     {
  97.         $this->address = new ArrayCollection();
  98.     }
  99.    
  100.    
  101.     public function getUsername() {
  102.         return $this->username;
  103.     }
  104.    
  105.     public function getPassword() {
  106.         return $this->password;
  107.     }
  108.    
  109.     public function getEmail() {
  110.         return $this->email;
  111.     }
  112.    
  113.     public function getRegisterDate() {
  114.         return $this->registerDate;
  115.     }
  116.    
  117.     public function getLastVisitDate() {
  118.         return $this->lastVisitDate;
  119.     }
  120.    
  121.     public function getRecoveryToken() {
  122.         return $this->recoveryToken;
  123.     }
  124.    
  125.     public function setUsername($username) {
  126.         $this->username = $username;
  127.     }
  128.    
  129.     public function setPassword($password) {
  130.         $this->password = $password;
  131.     }
  132.    
  133.     public function setEmail($email) {
  134.         $this->email = $email;
  135.     }
  136.    
  137.     public function setRegisterDate($registerDate) {
  138.         $this->registerDate = $registerDate;
  139.     }
  140.    
  141.     public function setLastVisitDate($lastVisitDate) {
  142.         $this->lastVisitDate = $lastVisitDate;
  143.     }
  144.    
  145.     public function setRecoveryToken($recoveryToken) {
  146.         $this->recoveryToken = $recoveryToken;
  147.     }
  148. }
  149. ?>
  150.  
  151. <?php
  152.  
  153. namespace App\Model\Entities;
  154.  
  155. use Doctrine\ORM\Mapping AS ORM;
  156. use Doctrine\Common\Collections\ArrayCollection;
  157. use Kdyby\Doctrine\Entities\BaseEntity;
  158. use Kdyby\Doctrine\Entities\Attributes\Identifier;
  159. use Nette\Security\Passwords;
  160.  
  161.  
  162. /**
  163.  * @ORM\Entity
  164.  * @ORM\Table(name="users")
  165.  */
  166.  
  167. class User extends BaseEntity
  168. {
  169.     /**
  170.      * @ORM\Id
  171.      * @ORM\Column(type="integer")
  172.      * @ORM\GeneratedValue
  173.      */
  174.     private $id;
  175.  
  176.     /**
  177.      * @ORM\Column(type="string", nullable=false)
  178.      * @var string
  179.      */
  180.     private $username;
  181.  
  182.     /**
  183.      * @ORM\Column(type="string", nullable=true)
  184.      * @var string
  185.      */
  186.     private $password;
  187.  
  188.     /**
  189.      * @ORM\Column(type="string", nullable=false)
  190.      * @var string
  191.      */
  192.     private $email;
  193.  
  194.     /**
  195.      * @ORM\ManyToOne(targetEntity="Addressbook")
  196.      * @ORM\JoinColumn(name="address_id", nullable=true, referencedColumnName="id", onDelete="RESTRICT")
  197.      */
  198.     protected $address;
  199.        
  200.     public function __construct()
  201.     {
  202.         $this->address = new ArrayCollection();
  203.     }
  204.    
  205.     public function getUsername() {
  206.         return $this->username;
  207.     }
  208.    
  209.     public function getPassword() {
  210.         return $this->password;
  211.     }
  212.    
  213.     public function getEmail() {
  214.         return $this->email;
  215.     }
  216.    
  217.    
  218.     public function setUsername($username) {
  219.         $this->username = $username;
  220.     }
  221.    
  222.     public function setPassword($password) {
  223.         $this->password = $password;
  224.     }
  225.    
  226. }
  227. ?>
Add Comment
Please, Sign In to add comment