Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?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;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement