aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Entity/Config.php
diff options
context:
space:
mode:
authorJeremy <jeremy.benoist@gmail.com>2015-02-16 21:28:49 +0100
committerJeremy <jeremy.benoist@gmail.com>2015-02-16 21:31:58 +0100
commit4d85d7e9ba676bd5ac3428976ce9227f460eb542 (patch)
treeacf77c5baced69e689fcfc2d9463a9b75b9b3657 /src/Wallabag/CoreBundle/Entity/Config.php
parent7a577c519ffc254b6ddecd75c9ee84f656d759e1 (diff)
downloadwallabag-4d85d7e9ba676bd5ac3428976ce9227f460eb542.tar.gz
wallabag-4d85d7e9ba676bd5ac3428976ce9227f460eb542.tar.zst
wallabag-4d85d7e9ba676bd5ac3428976ce9227f460eb542.zip
Implement simple config
Diffstat (limited to 'src/Wallabag/CoreBundle/Entity/Config.php')
-rw-r--r--src/Wallabag/CoreBundle/Entity/Config.php107
1 files changed, 89 insertions, 18 deletions
diff --git a/src/Wallabag/CoreBundle/Entity/Config.php b/src/Wallabag/CoreBundle/Entity/Config.php
index 14977d32..7b4464a1 100644
--- a/src/Wallabag/CoreBundle/Entity/Config.php
+++ b/src/Wallabag/CoreBundle/Entity/Config.php
@@ -8,6 +8,7 @@ use Symfony\Component\Validator\Constraints as Assert;
8/** 8/**
9 * Config 9 * Config
10 * 10 *
11 * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\ConfigRepository")
11 * @ORM\Table(name="config") 12 * @ORM\Table(name="config")
12 * @ORM\Entity 13 * @ORM\Entity
13 */ 14 */
@@ -26,16 +27,40 @@ class Config
26 * @var string 27 * @var string
27 * 28 *
28 * @Assert\NotBlank() 29 * @Assert\NotBlank()
29 * @ORM\Column(name="name", type="string", nullable=false) 30 * @ORM\Column(name="theme", type="string", nullable=false)
30 */ 31 */
31 private $name; 32 private $theme;
32 33
33 /** 34 /**
34 * @var string 35 * @var string
35 * 36 *
36 * @ORM\Column(name="value", type="blob", nullable=true) 37 * @Assert\NotBlank()
38 * @ORM\Column(name="items_per_page", type="integer", nullable=false)
39 */
40 private $items_per_page;
41
42 /**
43 * @var string
44 *
45 * @Assert\NotBlank()
46 * @ORM\Column(name="language", type="string", nullable=false)
37 */ 47 */
38 private $value; 48 private $language;
49
50 /**
51 * @ORM\ManyToOne(targetEntity="User", inversedBy="config")
52 */
53 private $user;
54
55 /*
56 * @param User $user
57 */
58 public function __construct(User $user)
59 {
60 $this->user = $user;
61 $this->items_per_page = 12;
62 $this->language = 'en_US';
63 }
39 64
40 /** 65 /**
41 * Get id 66 * Get id
@@ -48,48 +73,94 @@ class Config
48 } 73 }
49 74
50 /** 75 /**
51 * Set name 76 * Set theme
52 * 77 *
53 * @param string $name 78 * @param string $theme
54 * @return Config 79 * @return Config
55 */ 80 */
56 public function setName($name) 81 public function setTheme($theme)
57 { 82 {
58 $this->name = $name; 83 $this->theme = $theme;
59 84
60 return $this; 85 return $this;
61 } 86 }
62 87
63 /** 88 /**
64 * Get name 89 * Get theme
65 * 90 *
66 * @return string 91 * @return string
67 */ 92 */
68 public function getName() 93 public function getTheme()
69 { 94 {
70 return $this->name; 95 return $this->theme;
71 } 96 }
72 97
73 /** 98 /**
74 * Set value 99 * Set items_per_page
75 * 100 *
76 * @param string $value 101 * @param integer $itemsPerPage
77 * @return Config 102 * @return Config
78 */ 103 */
79 public function setValue($value) 104 public function setItemsPerPage($itemsPerPage)
80 { 105 {
81 $this->value = $value; 106 $this->items_per_page = $itemsPerPage;
82 107
83 return $this; 108 return $this;
84 } 109 }
85 110
86 /** 111 /**
87 * Get value 112 * Get items_per_page
113 *
114 * @return integer
115 */
116 public function getItemsPerPage()
117 {
118 return $this->items_per_page;
119 }
120
121 /**
122 * Set language
123 *
124 * @param string $language
125 * @return Config
126 */
127 public function setLanguage($language)
128 {
129 $this->language = $language;
130
131 return $this;
132 }
133
134 /**
135 * Get language
88 * 136 *
89 * @return string 137 * @return string
90 */ 138 */
91 public function getValue() 139 public function getLanguage()
140 {
141 return $this->language;
142 }
143
144 /**
145 * Set user
146 *
147 * @param \Wallabag\CoreBundle\Entity\User $user
148 * @return Config
149 */
150 public function setUser(\Wallabag\CoreBundle\Entity\User $user = null)
151 {
152 $this->user = $user;
153
154 return $this;
155 }
156
157 /**
158 * Get user
159 *
160 * @return \Wallabag\CoreBundle\Entity\User
161 */
162 public function getUser()
92 { 163 {
93 return $this->value; 164 return $this->user;
94 } 165 }
95} 166}