Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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
You can’t perform that action at this time.