Last active
August 29, 2015 14:01
-
-
Save Hounddog/9a3ca497b2f04b341f6f to your computer and use it in GitHub Desktop.
Composite key
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace API\V1\Entity; | |
| use Doctrine\ORM\Mapping AS ORM; | |
| use Doctrine\Common\Collections\ArrayCollection; | |
| /** | |
| * @package Model | |
| * @version | |
| * @ORM\Entity | |
| * @ORM\Table(name="oauth_users") | |
| * @ORM\ChangeTrackingPolicy("DEFERRED_EXPLICIT") | |
| */ | |
| class OAuthUser | |
| { | |
| /** | |
| * @var String | |
| * @ORM\Id @ORM\Column(name="username", type="string", length=255, nullable=false) | |
| */ | |
| protected $username; | |
| /** | |
| * @var String | |
| * @ORM\Column(name="email", type="string", length=2000, nullable=true) | |
| */ | |
| protected $email; | |
| /** | |
| * @var String | |
| * @ORM\Column(name="password", type="string", length=2000, nullable=true) | |
| */ | |
| protected $password; | |
| /** | |
| * @var String | |
| * @ORM\Column(name="first_name", type="string", length=255, nullable=true) | |
| */ | |
| protected $firstname; | |
| /** | |
| * @var String | |
| * @ORM\Column(name="last_name", type="string", length=255, nullable=true) | |
| */ | |
| protected $lastname; | |
| /** | |
| * @var String | |
| * @ORM\Column(name="activation_token", type="string", length=40, nullable=true) | |
| */ | |
| protected $activationToken; | |
| /** | |
| * @var int | |
| * @ORM\Column(name="active", type="integer", length=1, nullable=true) | |
| */ | |
| protected $active; | |
| public function getUsername() | |
| { | |
| return $this->name; | |
| } | |
| public function setUsername($name) | |
| { | |
| $this->name = $name; | |
| } | |
| public function getEmail() | |
| { | |
| return $this->email; | |
| } | |
| public function setEmail($email) | |
| { | |
| $this->email = $email; | |
| } | |
| public function setPassword($password) | |
| { | |
| $this->password = $password; | |
| } | |
| public function getPassword() | |
| { | |
| return $this->password; | |
| } | |
| /** | |
| * @return integer $firstname | |
| */ | |
| public function getFirstname() | |
| { | |
| return $this->firstname; | |
| } | |
| /** | |
| * @param integer $firstname | |
| * @return Site | |
| */ | |
| public function setFirstname($firstname) | |
| { | |
| $this->firstname = $firstname; | |
| return $this; | |
| } | |
| /** | |
| * @return integer $lastname | |
| */ | |
| public function getLastname() | |
| { | |
| return $this->lastname; | |
| } | |
| /** | |
| * @param integer $lastname | |
| * @return Site | |
| */ | |
| public function setLastname($lastname) | |
| { | |
| $this->lastname = $lastname; | |
| return $this; | |
| } | |
| /** | |
| * @return string $activationToken | |
| */ | |
| public function getActivationToken() | |
| { | |
| return $this->activationToken; | |
| } | |
| /** | |
| * @param string $activationToken | |
| * @return activationToken | |
| */ | |
| public function setActivationToken($activationToken) | |
| { | |
| $this->activationToken= $activationToken; | |
| return $this; | |
| } | |
| /** | |
| * @return int $active | |
| */ | |
| public function getActive() | |
| { | |
| return $this->active; | |
| } | |
| /** | |
| * @param int $active | |
| * @return active | |
| */ | |
| public function setActive($active) | |
| { | |
| $this->active= $active; | |
| return $this; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace API\V1\Entity; | |
| use Doctrine\ORM\Mapping AS ORM; | |
| use Doctrine\Common\Collections\ArrayCollection; | |
| use Base\Entity\AbstractEntity; | |
| /** | |
| * @package Model | |
| * @version | |
| * @ORM\Entity | |
| * @ORM\Table(name="site") | |
| * @ORM\ChangeTrackingPolicy("DEFERRED_EXPLICIT") | |
| */ | |
| class Site extends AbstractEntity | |
| { | |
| /** | |
| * @ORM\Column(name="name", type="string", nullable=false) | |
| */ | |
| protected $name; | |
| /** | |
| * @var \Doctrine\Common\Collections\ArrayCollection | |
| * @ORM\OneToMany(targetEntity="API\V1\Entity\OAuthUser", mappedBy="idSite") | |
| **/ | |
| protected $hashtags; | |
| /** | |
| * @ORM\Id @ORM\ManyToOne(targetEntity="API\V1\Entity\OAuthUser") | |
| * @ORM\JoinColumn(name="user_id", referencedColumnName="username") | |
| */ | |
| protected $user; | |
| /** | |
| * @ORM\ManyToOne(targetEntity="API\V1\Entity\Theme") | |
| */ | |
| protected $theme; | |
| /** @ORM\Column(name="header", type="string", length=2000, nullable=true) */ | |
| protected $header; | |
| public function __construct() { | |
| $this->hashtags = new ArrayCollection(); | |
| } | |
| /** | |
| * @return string $name | |
| */ | |
| public function getName() | |
| { | |
| return $this->name; | |
| } | |
| /** | |
| * @param string $name | |
| * @return Site | |
| */ | |
| public function setName($name) | |
| { | |
| $this->name = $name; | |
| return $this; | |
| } | |
| public function setHashtags($hashtags) | |
| { | |
| $this->hashtags = $hashtags; | |
| } | |
| public function getHashtags() | |
| { | |
| return $this->hashtags; | |
| } | |
| /** | |
| * @return string $user | |
| */ | |
| public function getUser() | |
| { | |
| return $this->user; | |
| } | |
| /** | |
| * @param string $user | |
| * @return Site | |
| */ | |
| public function setUser($user) | |
| { | |
| $this->user = $user; | |
| return $this; | |
| } | |
| /** | |
| * @return string $backgroundColor | |
| */ | |
| public function getBackgroundColor() | |
| { | |
| return $this->backgroundColor; | |
| } | |
| /** | |
| * @param string $backgroundColor | |
| * @return Site | |
| */ | |
| public function setBackgroundColor($backgroundColor) | |
| { | |
| $this->backgroundColor = $backgroundColor; | |
| return $this; | |
| } | |
| /** | |
| * @return string $headerBackgroundColor | |
| */ | |
| public function getHeaderBackgroundColor() | |
| { | |
| return $this->headerBackgroundColor; | |
| } | |
| /** | |
| * @param string $headerBackgroundColor | |
| * @return Site | |
| */ | |
| public function setHeaderBackgroundColor($headerBackgroundColor) | |
| { | |
| $this->headerBackgroundColor = $headerBackgroundColor; | |
| return $this; | |
| } | |
| /** | |
| * @return string $header | |
| */ | |
| public function getHeader() | |
| { | |
| return $this->header; | |
| } | |
| /** | |
| * @param string $header | |
| * @return Site | |
| */ | |
| public function setHeader($header) | |
| { | |
| $this->header = $header; | |
| return $this; | |
| } | |
| /** | |
| * @return string $header | |
| */ | |
| public function getTheme() | |
| { | |
| return $this->theme; | |
| } | |
| /** | |
| * @param string $theme | |
| * @return Site | |
| */ | |
| public function setTheme($theme) | |
| { | |
| $this->theme = $theme; | |
| return $this; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment