mirror of
https://github.com/wallabag/wallabag.git
synced 2024-06-02 08:32:43 +00:00
8d4ed0df06
Also CS (because cs-fixer got an update) Package operations: 0 installs, 26 updates, 0 removals - Updating twig/twig (v2.12.1 => v2.12.2) - Updating symfony/symfony (v3.4.33 => v3.4.34) - Updating doctrine/event-manager (v1.0.0 => 1.1.0) - Updating doctrine/collections (v1.6.2 => 1.6.3) - Updating doctrine/cache (v1.8.1 => 1.9.0) - Updating doctrine/persistence (1.1.1 => 1.2.0) - Updating doctrine/inflector (v1.3.0 => 1.3.1) - Updating symfony/mime (v4.3.5 => v4.3.7) - Updating swiftmailer/swiftmailer (v6.2.1 => v6.2.3) - Updating symfony/swiftmailer-bundle (v3.3.0 => v3.3.1) - Updating doctrine/dbal (v2.9.2 => v2.9.3) - Updating doctrine/instantiator (1.2.0 => 1.3.0) - Updating j0k3r/graby-site-config (1.0.93 => 1.0.94) - Updating phpoption/phpoption (1.5.0 => 1.5.2) - Updating symfony/http-client-contracts (v1.1.7 => v1.1.8) - Updating symfony/http-client (v4.3.5 => v4.3.7) - Updating sensiolabs/security-checker (v6.0.2 => v6.0.3) - Updating paragonie/constant_time_encoding (v2.2.3 => v2.3.0) - Updating scheb/two-factor-bundle (v4.7.1 => v4.8.0) - Updating symfony/phpunit-bridge (v4.3.6 => v4.3.7) - Updating composer/xdebug-handler (1.3.3 => 1.4.0) - Updating friendsofphp/php-cs-fixer (v2.15.3 => v2.16.0) - Updating doctrine/data-fixtures (v1.3.2 => 1.3.3) - Updating nette/schema (v1.0.0 => v1.0.1) - Updating nikic/php-parser (v4.2.4 => v4.3.0) - Updating sentry/sentry (2.2.2 => 2.2.4)
391 lines
6.8 KiB
PHP
391 lines
6.8 KiB
PHP
<?php
|
|
|
|
namespace Wallabag\CoreBundle\Entity;
|
|
|
|
use Doctrine\Common\Collections\ArrayCollection;
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
use Symfony\Component\Validator\Constraints as Assert;
|
|
use Wallabag\UserBundle\Entity\User;
|
|
|
|
/**
|
|
* Config.
|
|
*
|
|
* @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\ConfigRepository")
|
|
* @ORM\Table(
|
|
* name="`config`",
|
|
* indexes={
|
|
* @ORM\Index(name="config_feed_token", columns={"feed_token"}, options={"lengths"={255}}),
|
|
* }
|
|
* )
|
|
*/
|
|
class Config
|
|
{
|
|
const REDIRECT_TO_HOMEPAGE = 0;
|
|
const REDIRECT_TO_CURRENT_PAGE = 1;
|
|
|
|
/**
|
|
* @var int
|
|
*
|
|
* @ORM\Column(name="id", type="integer")
|
|
* @ORM\Id
|
|
* @ORM\GeneratedValue(strategy="AUTO")
|
|
*/
|
|
private $id;
|
|
|
|
/**
|
|
* @var string
|
|
*
|
|
* @Assert\NotBlank()
|
|
* @ORM\Column(name="theme", type="string", nullable=false)
|
|
*/
|
|
private $theme;
|
|
|
|
/**
|
|
* @var int
|
|
*
|
|
* @Assert\NotBlank()
|
|
* @Assert\Range(
|
|
* min = 1,
|
|
* max = 100000,
|
|
* maxMessage = "validator.item_per_page_too_high"
|
|
* )
|
|
* @ORM\Column(name="items_per_page", type="integer", nullable=false)
|
|
*/
|
|
private $itemsPerPage;
|
|
|
|
/**
|
|
* @var string
|
|
*
|
|
* @Assert\NotBlank()
|
|
* @ORM\Column(name="language", type="string", nullable=false)
|
|
*/
|
|
private $language;
|
|
|
|
/**
|
|
* @var string
|
|
*
|
|
* @ORM\Column(name="feed_token", type="string", nullable=true)
|
|
*/
|
|
private $feedToken;
|
|
|
|
/**
|
|
* @var int
|
|
*
|
|
* @ORM\Column(name="feed_limit", type="integer", nullable=true)
|
|
* @Assert\Range(
|
|
* min = 1,
|
|
* max = 100000,
|
|
* maxMessage = "validator.feed_limit_too_high"
|
|
* )
|
|
*/
|
|
private $feedLimit;
|
|
|
|
/**
|
|
* @var float
|
|
*
|
|
* @ORM\Column(name="reading_speed", type="float", nullable=true)
|
|
*/
|
|
private $readingSpeed;
|
|
|
|
/**
|
|
* @var string
|
|
*
|
|
* @ORM\Column(name="pocket_consumer_key", type="string", nullable=true)
|
|
*/
|
|
private $pocketConsumerKey;
|
|
|
|
/**
|
|
* @var int
|
|
*
|
|
* @ORM\Column(name="action_mark_as_read", type="integer", nullable=true, options={"default" = 0})
|
|
*/
|
|
private $actionMarkAsRead;
|
|
|
|
/**
|
|
* @var int
|
|
*
|
|
* @ORM\Column(name="list_mode", type="integer", nullable=true)
|
|
*/
|
|
private $listMode;
|
|
|
|
/**
|
|
* @ORM\OneToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="config")
|
|
*/
|
|
private $user;
|
|
|
|
/**
|
|
* @ORM\OneToMany(targetEntity="Wallabag\CoreBundle\Entity\TaggingRule", mappedBy="config", cascade={"remove"})
|
|
* @ORM\OrderBy({"id" = "ASC"})
|
|
*/
|
|
private $taggingRules;
|
|
|
|
/*
|
|
* @param User $user
|
|
*/
|
|
public function __construct(User $user)
|
|
{
|
|
$this->user = $user;
|
|
$this->taggingRules = new ArrayCollection();
|
|
}
|
|
|
|
/**
|
|
* Get id.
|
|
*
|
|
* @return int
|
|
*/
|
|
public function getId()
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
/**
|
|
* Set theme.
|
|
*
|
|
* @param string $theme
|
|
*
|
|
* @return Config
|
|
*/
|
|
public function setTheme($theme)
|
|
{
|
|
$this->theme = $theme;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get theme.
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getTheme()
|
|
{
|
|
return $this->theme;
|
|
}
|
|
|
|
/**
|
|
* Set itemsPerPage.
|
|
*
|
|
* @param int $itemsPerPage
|
|
*
|
|
* @return Config
|
|
*/
|
|
public function setItemsPerPage($itemsPerPage)
|
|
{
|
|
$this->itemsPerPage = $itemsPerPage;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get itemsPerPage.
|
|
*
|
|
* @return int
|
|
*/
|
|
public function getItemsPerPage()
|
|
{
|
|
return $this->itemsPerPage;
|
|
}
|
|
|
|
/**
|
|
* Set language.
|
|
*
|
|
* @param string $language
|
|
*
|
|
* @return Config
|
|
*/
|
|
public function setLanguage($language)
|
|
{
|
|
$this->language = $language;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get language.
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getLanguage()
|
|
{
|
|
return $this->language;
|
|
}
|
|
|
|
/**
|
|
* Set user.
|
|
*
|
|
* @param User $user
|
|
*
|
|
* @return Config
|
|
*/
|
|
public function setUser(User $user = null)
|
|
{
|
|
$this->user = $user;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get user.
|
|
*
|
|
* @return User
|
|
*/
|
|
public function getUser()
|
|
{
|
|
return $this->user;
|
|
}
|
|
|
|
/**
|
|
* Set feed Token.
|
|
*
|
|
* @param string $feedToken
|
|
*
|
|
* @return Config
|
|
*/
|
|
public function setFeedToken($feedToken)
|
|
{
|
|
$this->feedToken = $feedToken;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get feedToken.
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getFeedToken()
|
|
{
|
|
return $this->feedToken;
|
|
}
|
|
|
|
/**
|
|
* Set Feed Limit.
|
|
*
|
|
* @param int $feedLimit
|
|
*
|
|
* @return Config
|
|
*/
|
|
public function setFeedLimit($feedLimit)
|
|
{
|
|
$this->feedLimit = $feedLimit;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get Feed Limit.
|
|
*
|
|
* @return int
|
|
*/
|
|
public function getFeedLimit()
|
|
{
|
|
return $this->feedLimit;
|
|
}
|
|
|
|
/**
|
|
* Set readingSpeed.
|
|
*
|
|
* @param float $readingSpeed
|
|
*
|
|
* @return Config
|
|
*/
|
|
public function setReadingSpeed($readingSpeed)
|
|
{
|
|
$this->readingSpeed = $readingSpeed;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get readingSpeed.
|
|
*
|
|
* @return float
|
|
*/
|
|
public function getReadingSpeed()
|
|
{
|
|
return $this->readingSpeed;
|
|
}
|
|
|
|
/**
|
|
* Set pocketConsumerKey.
|
|
*
|
|
* @param string $pocketConsumerKey
|
|
*
|
|
* @return Config
|
|
*/
|
|
public function setPocketConsumerKey($pocketConsumerKey)
|
|
{
|
|
$this->pocketConsumerKey = $pocketConsumerKey;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get pocketConsumerKey.
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getPocketConsumerKey()
|
|
{
|
|
return $this->pocketConsumerKey;
|
|
}
|
|
|
|
/**
|
|
* @return int
|
|
*/
|
|
public function getActionMarkAsRead()
|
|
{
|
|
return $this->actionMarkAsRead;
|
|
}
|
|
|
|
/**
|
|
* @param int $actionMarkAsRead
|
|
*
|
|
* @return Config
|
|
*/
|
|
public function setActionMarkAsRead($actionMarkAsRead)
|
|
{
|
|
$this->actionMarkAsRead = $actionMarkAsRead;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* @return int
|
|
*/
|
|
public function getListMode()
|
|
{
|
|
return $this->listMode;
|
|
}
|
|
|
|
/**
|
|
* @param int $listMode
|
|
*
|
|
* @return Config
|
|
*/
|
|
public function setListMode($listMode)
|
|
{
|
|
$this->listMode = $listMode;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* @return Config
|
|
*/
|
|
public function addTaggingRule(TaggingRule $rule)
|
|
{
|
|
$this->taggingRules[] = $rule;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* @return ArrayCollection<TaggingRule>
|
|
*/
|
|
public function getTaggingRules()
|
|
{
|
|
return $this->taggingRules;
|
|
}
|
|
}
|