wallabag/src/Wallabag/CoreBundle/Entity/Config.php

225 lines
3.7 KiB
PHP
Raw Normal View History

2015-01-22 16:18:56 +00:00
<?php
namespace Wallabag\CoreBundle\Entity;
2015-01-22 16:18:56 +00:00
use Doctrine\ORM\Mapping as ORM;
2015-02-11 20:06:32 +00:00
use Symfony\Component\Validator\Constraints as Assert;
2015-01-22 16:18:56 +00:00
/**
* Config
*
2015-02-16 20:28:49 +00:00
* @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\ConfigRepository")
2015-01-22 16:18:56 +00:00
* @ORM\Table(name="config")
* @ORM\Entity
*/
class Config
{
/**
* @var integer
*
2015-02-11 20:06:32 +00:00
* @ORM\Column(name="id", type="integer")
2015-01-22 16:18:56 +00:00
* @ORM\Id
2015-02-11 20:06:32 +00:00
* @ORM\GeneratedValue(strategy="AUTO")
2015-01-22 16:18:56 +00:00
*/
private $id;
/**
* @var string
*
2015-02-11 20:06:32 +00:00
* @Assert\NotBlank()
2015-02-16 20:28:49 +00:00
* @ORM\Column(name="theme", type="string", nullable=false)
2015-01-22 16:18:56 +00:00
*/
2015-02-16 20:28:49 +00:00
private $theme;
2015-01-22 16:18:56 +00:00
/**
2015-03-28 13:27:45 +00:00
* @var integer
2015-01-22 16:18:56 +00:00
*
2015-02-16 20:28:49 +00:00
* @Assert\NotBlank()
* @ORM\Column(name="items_per_page", type="integer", nullable=false)
*/
2015-03-28 13:27:45 +00:00
private $itemsPerPage;
2015-02-16 20:28:49 +00:00
/**
* @var string
*
* @Assert\NotBlank()
* @ORM\Column(name="language", type="string", nullable=false)
2015-01-22 16:18:56 +00:00
*/
2015-02-16 20:28:49 +00:00
private $language;
2015-03-28 13:27:45 +00:00
/**
* @var string
*
* @ORM\Column(name="rss_token", type="string", nullable=true)
*/
private $rssToken;
/**
* @var integer
*
* @ORM\Column(name="rss_limit", type="integer", nullable=true)
*/
private $rssLimit;
2015-02-16 20:28:49 +00:00
/**
* @ORM\OneToOne(targetEntity="User", inversedBy="config")
2015-02-16 20:28:49 +00:00
*/
private $user;
/*
* @param User $user
*/
public function __construct(User $user)
{
$this->user = $user;
}
2015-01-22 16:18:56 +00:00
/**
* Get id
*
2015-01-31 18:09:34 +00:00
* @return integer
2015-01-22 16:18:56 +00:00
*/
public function getId()
{
return $this->id;
}
/**
2015-02-16 20:28:49 +00:00
* Set theme
2015-01-22 16:18:56 +00:00
*
2015-02-16 20:28:49 +00:00
* @param string $theme
2015-01-22 16:18:56 +00:00
* @return Config
*/
2015-02-16 20:28:49 +00:00
public function setTheme($theme)
2015-01-22 16:18:56 +00:00
{
2015-02-16 20:28:49 +00:00
$this->theme = $theme;
2015-01-22 16:18:56 +00:00
return $this;
}
/**
2015-02-16 20:28:49 +00:00
* Get theme
2015-01-22 16:18:56 +00:00
*
2015-01-31 18:09:34 +00:00
* @return string
2015-01-22 16:18:56 +00:00
*/
2015-02-16 20:28:49 +00:00
public function getTheme()
2015-01-22 16:18:56 +00:00
{
2015-02-16 20:28:49 +00:00
return $this->theme;
2015-01-22 16:18:56 +00:00
}
/**
2015-03-28 13:27:45 +00:00
* Set itemsPerPage
2015-01-22 16:18:56 +00:00
*
2015-02-16 20:28:49 +00:00
* @param integer $itemsPerPage
2015-01-22 16:18:56 +00:00
* @return Config
*/
2015-02-16 20:28:49 +00:00
public function setItemsPerPage($itemsPerPage)
2015-01-22 16:18:56 +00:00
{
2015-03-28 13:27:45 +00:00
$this->itemsPerPage = $itemsPerPage;
2015-01-22 16:18:56 +00:00
return $this;
}
/**
2015-03-28 13:27:45 +00:00
* Get itemsPerPage
2015-02-16 20:28:49 +00:00
*
* @return integer
*/
public function getItemsPerPage()
{
2015-03-28 13:27:45 +00:00
return $this->itemsPerPage;
2015-02-16 20:28:49 +00:00
}
/**
* Set language
*
* @param string $language
* @return Config
*/
public function setLanguage($language)
{
$this->language = $language;
return $this;
}
/**
* Get language
2015-01-22 16:18:56 +00:00
*
2015-01-31 18:09:34 +00:00
* @return string
2015-01-22 16:18:56 +00:00
*/
2015-02-16 20:28:49 +00:00
public function getLanguage()
{
return $this->language;
}
/**
* Set user
*
* @param \Wallabag\CoreBundle\Entity\User $user
* @return Config
*/
public function setUser(\Wallabag\CoreBundle\Entity\User $user = null)
{
$this->user = $user;
return $this;
}
/**
* Get user
*
* @return \Wallabag\CoreBundle\Entity\User
*/
public function getUser()
2015-01-22 16:18:56 +00:00
{
2015-02-16 20:28:49 +00:00
return $this->user;
2015-01-22 16:18:56 +00:00
}
2015-03-28 13:27:45 +00:00
/**
* Set rssToken
*
* @param string $rssToken
* @return Config
*/
public function setRssToken($rssToken)
{
$this->rssToken = $rssToken;
return $this;
}
/**
* Get rssToken
*
* @return string
*/
public function getRssToken()
{
return $this->rssToken;
}
/**
* Set rssLimit
*
* @param string $rssLimit
* @return Config
*/
public function setRssLimit($rssLimit)
{
$this->rssLimit = $rssLimit;
return $this;
}
/**
* Get rssLimit
*
* @return string
*/
public function getRssLimit()
{
return $this->rssLimit;
}
2015-01-22 16:18:56 +00:00
}