Last active
October 9, 2015 19:46
-
-
Save JoshuaEstes/0a4596afc5c8f8594207 to your computer and use it in GitHub Desktop.
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 AppBundle\Entity; | |
use Symfony\Component\Security\Core\User\UserInterface; | |
class UserSetting | |
{ | |
/** | |
* @var UserInterface | |
* @ORM\ManyToOne(targetEntity="User", inversedBy="settings", fetch="EXTRA_LAZY") | |
* @ORM\JoinColumn(name="user_id", referencedColumnName="id") | |
*/ | |
protected $user; | |
/** | |
* @var string | |
*/ | |
protected $key; | |
/** | |
* @var string | |
*/ | |
protected $value; | |
/** | |
* Just for easying the creation of new UserSetting objects | |
* | |
* @param string $key | |
* @param string $value | |
*/ | |
public function __construct($key = null, $value = null) | |
{ | |
$this->key = $key; | |
$this->value = $value; | |
} | |
/** | |
* Magic Method | |
*/ | |
public function __toString() | |
{ | |
return (string) $this->value; | |
} | |
/** | |
* @return UserInterface | |
*/ | |
public function getUser() | |
{ | |
$this->user; | |
} | |
/** | |
* @param UserInterface $user | |
* @return self | |
*/ | |
public function setUser(UserInterface $user) | |
{ | |
$this->user = $user; | |
return $this; | |
} | |
public function getKey() | |
{ | |
return $this->key; | |
} | |
public function setKey($key) | |
{ | |
$this->key = $key; | |
return $tihs; | |
} | |
public function getValue() | |
{ | |
return $this->value; | |
} | |
public function setValue($value) | |
{ | |
$this->value = $value; | |
return $this; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment