Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace App\Model\Entities;
- use Doctrine\Common\Collections\ArrayCollection;
- use Doctrine\ORM\Mapping AS ORM;
- use Kdyby\Doctrine\Entities\BaseEntity;
- /**
- * @ORM\Entity
- */
- class Addressbook extends BaseEntity
- {
- /**
- * @ORM\Id
- * @ORM\Column(type="integer")
- * @ORM\GeneratedValue
- */
- private $id;
- /**
- * @ORM\ManyToOne(targetEntity="User")
- * @ORM\JoinColumn(name="user_id", nullable=true, referencedColumnName="id", onDelete="RESTRICT")
- */
- protected $user;
- /**
- * @ORM\Column(type="string", nullable=false)
- * @var string
- */
- private $subject;
- public function __construct()
- {
- $this->user = new User();
- }
- public function getSubject() {
- return $this->subject;
- }
- public function setSubject($subject) {
- $this->subject = $subject;
- }
- }
- ?>
- <?php
- namespace App\Model\Entities;
- use Doctrine\ORM\Mapping AS ORM;
- use Doctrine\Common\Collections\ArrayCollection;
- use Kdyby\Doctrine\Entities\BaseEntity;
- use Kdyby\Doctrine\Entities\Attributes\Identifier;
- use Nette\Security\Passwords;
- /**
- * @ORM\Entity
- * @ORM\Table(name="users")
- */
- class User extends BaseEntity
- {
- /**
- * @ORM\Id
- * @ORM\Column(type="integer")
- * @ORM\GeneratedValue
- */
- private $id;
- /**
- * @ORM\Column(type="string", nullable=false)
- * @var string
- */
- private $username;
- /**
- * @ORM\Column(type="string", nullable=true)
- * @var string
- */
- private $password;
- /**
- * @ORM\ManyToOne(targetEntity="Addressbook")
- * @ORM\JoinColumn(name="address_id", nullable=true, referencedColumnName="id", onDelete="RESTRICT")
- */
- protected $address;
- public function __construct()
- {
- $this->address = new ArrayCollection();
- }
- public function getUsername() {
- return $this->username;
- }
- public function getPassword() {
- return $this->password;
- }
- public function getEmail() {
- return $this->email;
- }
- public function getRegisterDate() {
- return $this->registerDate;
- }
- public function getLastVisitDate() {
- return $this->lastVisitDate;
- }
- public function getRecoveryToken() {
- return $this->recoveryToken;
- }
- public function setUsername($username) {
- $this->username = $username;
- }
- public function setPassword($password) {
- $this->password = $password;
- }
- public function setEmail($email) {
- $this->email = $email;
- }
- public function setRegisterDate($registerDate) {
- $this->registerDate = $registerDate;
- }
- public function setLastVisitDate($lastVisitDate) {
- $this->lastVisitDate = $lastVisitDate;
- }
- public function setRecoveryToken($recoveryToken) {
- $this->recoveryToken = $recoveryToken;
- }
- }
- ?>
- <?php
- namespace App\Model\Entities;
- use Doctrine\ORM\Mapping AS ORM;
- use Doctrine\Common\Collections\ArrayCollection;
- use Kdyby\Doctrine\Entities\BaseEntity;
- use Kdyby\Doctrine\Entities\Attributes\Identifier;
- use Nette\Security\Passwords;
- /**
- * @ORM\Entity
- * @ORM\Table(name="users")
- */
- class User extends BaseEntity
- {
- /**
- * @ORM\Id
- * @ORM\Column(type="integer")
- * @ORM\GeneratedValue
- */
- private $id;
- /**
- * @ORM\Column(type="string", nullable=false)
- * @var string
- */
- private $username;
- /**
- * @ORM\Column(type="string", nullable=true)
- * @var string
- */
- private $password;
- /**
- * @ORM\Column(type="string", nullable=false)
- * @var string
- */
- private $email;
- /**
- * @ORM\ManyToOne(targetEntity="Addressbook")
- * @ORM\JoinColumn(name="address_id", nullable=true, referencedColumnName="id", onDelete="RESTRICT")
- */
- protected $address;
- public function __construct()
- {
- $this->address = new ArrayCollection();
- }
- public function getUsername() {
- return $this->username;
- }
- public function getPassword() {
- return $this->password;
- }
- public function getEmail() {
- return $this->email;
- }
- public function setUsername($username) {
- $this->username = $username;
- }
- public function setPassword($password) {
- $this->password = $password;
- }
- }
- ?>
Add Comment
Please, Sign In to add comment