aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Entity
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/CoreBundle/Entity')
-rw-r--r--src/Wallabag/CoreBundle/Entity/Config.php84
-rw-r--r--src/Wallabag/CoreBundle/Entity/User.php2
2 files changed, 77 insertions, 9 deletions
diff --git a/src/Wallabag/CoreBundle/Entity/Config.php b/src/Wallabag/CoreBundle/Entity/Config.php
index 91f9bfe8..9f079656 100644
--- a/src/Wallabag/CoreBundle/Entity/Config.php
+++ b/src/Wallabag/CoreBundle/Entity/Config.php
@@ -32,12 +32,17 @@ class Config
32 private $theme; 32 private $theme;
33 33
34 /** 34 /**
35 * @var string 35 * @var integer
36 * 36 *
37 * @Assert\NotBlank() 37 * @Assert\NotBlank()
38 * @Assert\Range(
39 * min = 1,
40 * max = 100000,
41 * maxMessage = "This will certainly kill the app"
42 * )
38 * @ORM\Column(name="items_per_page", type="integer", nullable=false) 43 * @ORM\Column(name="items_per_page", type="integer", nullable=false)
39 */ 44 */
40 private $items_per_page; 45 private $itemsPerPage;
41 46
42 /** 47 /**
43 * @var string 48 * @var string
@@ -48,6 +53,25 @@ class Config
48 private $language; 53 private $language;
49 54
50 /** 55 /**
56 * @var string
57 *
58 * @ORM\Column(name="rss_token", type="string", nullable=true)
59 */
60 private $rssToken;
61
62 /**
63 * @var integer
64 *
65 * @ORM\Column(name="rss_limit", type="integer", nullable=true)
66 * @Assert\Range(
67 * min = 1,
68 * max = 100000,
69 * maxMessage = "This will certainly kill the app"
70 * )
71 */
72 private $rssLimit;
73
74 /**
51 * @ORM\OneToOne(targetEntity="User", inversedBy="config") 75 * @ORM\OneToOne(targetEntity="User", inversedBy="config")
52 */ 76 */
53 private $user; 77 private $user;
@@ -58,8 +82,6 @@ class Config
58 public function __construct(User $user) 82 public function __construct(User $user)
59 { 83 {
60 $this->user = $user; 84 $this->user = $user;
61 $this->items_per_page = 12;
62 $this->language = 'en_US';
63 } 85 }
64 86
65 /** 87 /**
@@ -96,26 +118,26 @@ class Config
96 } 118 }
97 119
98 /** 120 /**
99 * Set items_per_page 121 * Set itemsPerPage
100 * 122 *
101 * @param integer $itemsPerPage 123 * @param integer $itemsPerPage
102 * @return Config 124 * @return Config
103 */ 125 */
104 public function setItemsPerPage($itemsPerPage) 126 public function setItemsPerPage($itemsPerPage)
105 { 127 {
106 $this->items_per_page = $itemsPerPage; 128 $this->itemsPerPage = $itemsPerPage;
107 129
108 return $this; 130 return $this;
109 } 131 }
110 132
111 /** 133 /**
112 * Get items_per_page 134 * Get itemsPerPage
113 * 135 *
114 * @return integer 136 * @return integer
115 */ 137 */
116 public function getItemsPerPage() 138 public function getItemsPerPage()
117 { 139 {
118 return $this->items_per_page; 140 return $this->itemsPerPage;
119 } 141 }
120 142
121 /** 143 /**
@@ -163,4 +185,50 @@ class Config
163 { 185 {
164 return $this->user; 186 return $this->user;
165 } 187 }
188
189 /**
190 * Set rssToken
191 *
192 * @param string $rssToken
193 * @return Config
194 */
195 public function setRssToken($rssToken)
196 {
197 $this->rssToken = $rssToken;
198
199 return $this;
200 }
201
202 /**
203 * Get rssToken
204 *
205 * @return string
206 */
207 public function getRssToken()
208 {
209 return $this->rssToken;
210 }
211
212 /**
213 * Set rssLimit
214 *
215 * @param string $rssLimit
216 * @return Config
217 */
218 public function setRssLimit($rssLimit)
219 {
220 $this->rssLimit = $rssLimit;
221
222 return $this;
223 }
224
225 /**
226 * Get rssLimit
227 *
228 * @return string
229 */
230 public function getRssLimit()
231 {
232 return $this->rssLimit;
233 }
166} 234}
diff --git a/src/Wallabag/CoreBundle/Entity/User.php b/src/Wallabag/CoreBundle/Entity/User.php
index 6a7619ac..e75e3a83 100644
--- a/src/Wallabag/CoreBundle/Entity/User.php
+++ b/src/Wallabag/CoreBundle/Entity/User.php
@@ -14,7 +14,7 @@ use JMS\Serializer\Annotation\Expose;
14 * User 14 * User
15 * 15 *
16 * @ORM\Table(name="user") 16 * @ORM\Table(name="user")
17 * @ORM\Entity 17 * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\UserRepository")
18 * @ORM\HasLifecycleCallbacks() 18 * @ORM\HasLifecycleCallbacks()
19 * @ExclusionPolicy("all") 19 * @ExclusionPolicy("all")
20 */ 20 */