1: <?php
2: namespace Charcoal\Cms\Config;
3:
4: // dependencies from `charcoal-config`
5: use Charcoal\Config\AbstractConfig;
6:
7: /**
8: * News Config
9: */
10: class NewsConfig extends AbstractConfig
11: {
12: /**
13: * @var integer
14: */
15: private $numPerPage;
16:
17: /**
18: * @var string
19: */
20: private $entryCycle;
21:
22: /**
23: * @var string
24: */
25: private $defaultExpiry;
26:
27: /**
28: * @var string
29: */
30: private $median;
31:
32: /**
33: * @var string
34: */
35: private $objType;
36:
37: /**
38: * @var string
39: */
40: private $category;
41:
42: /**
43: * @var string
44: */
45: private $configFeatIdent;
46:
47: /**
48: * @var array
49: */
50: private $thumbnail;
51:
52: /**
53: * l10n
54: * @var string
55: */
56: private $parentSectionSlug;
57:
58: /**
59: * @return integer Number of items per page.
60: */
61: public function numPerPage()
62: {
63: return $this->numPerPage;
64: }
65:
66: /**
67: * @return boolean Entry cycle.
68: */
69: public function entryCycle()
70: {
71: return $this->entryCycle;
72: }
73:
74: /**
75: * Valid DateTime string
76: * @return string News expiry.
77: */
78: public function defaultExpiry()
79: {
80: return $this->defaultExpiry;
81: }
82:
83: /**
84: * @todo Tell me more about this.
85: * @return string Datetime value.
86: */
87: public function median()
88: {
89: return $this->median;
90: }
91:
92: /**
93: * @return string News Object type.
94: */
95: public function objType()
96: {
97: return $this->objType;
98: }
99:
100: /**
101: * @return string Category object.
102: */
103: public function category()
104: {
105: return $this->category;
106: }
107:
108: /**
109: * @return string Config property.
110: */
111: public function configFeatIdent()
112: {
113: return $this->configFeatIdent;
114: }
115:
116: /**
117: * @return array Thumbnail generation values.
118: */
119: public function thumbnail()
120: {
121: return $this->thumbnail;
122: }
123:
124: /**
125: * @return string News parent section slug.
126: */
127: public function parentSectionSlug()
128: {
129: return $this->parentSectionSlug;
130: }
131:
132: /**
133: * @param integer $numPerPage Number of news per page.
134: * @return NewsConfig
135: */
136: public function setNumPerPage($numPerPage)
137: {
138: $this->numPerPage = $numPerPage;
139:
140: return $this;
141: }
142:
143: /**
144: * @param boolean $entryCycle Cycle news or not.
145: * @return NewsConfig
146: */
147: public function setEntryCycle($entryCycle)
148: {
149: $this->entryCycle = $entryCycle;
150:
151: return $this;
152: }
153:
154: /**
155: * Accept all DateTime string.
156: * @param string $defaultExpiry Expiry.
157: * @return NewsConfig
158: */
159: public function setDefaultExpiry($defaultExpiry)
160: {
161: $this->defaultExpiry = $defaultExpiry;
162:
163: return $this;
164: }
165:
166: /**
167: * @todo What is this?
168: * @param string $median DateTime string.
169: * @return NewsConfig
170: */
171: public function setMedian($median)
172: {
173: $this->median = $median;
174:
175: return $this;
176: }
177:
178: /**
179: * @param string $objType News object type.
180: * @return NewsConfig
181: */
182: public function setObjType($objType)
183: {
184: $this->objType = $objType;
185:
186: return $this;
187: }
188:
189: /**
190: * @param string $category News category object.
191: * @return NewsConfig
192: */
193: public function setCategory($category)
194: {
195: $this->category = $category;
196:
197: return $this;
198: }
199:
200: /**
201: * Might be overkill.
202: * @param string $configFeatIdent Config property containing featured news.
203: * @return NewsConfig
204: */
205: public function setConfigFeatIdent($configFeatIdent)
206: {
207: $this->configFeatIdent = $configFeatIdent;
208:
209: return $this;
210: }
211:
212: /**
213: * resize -> width.
214: * @param array $thumbnail News thumbnail size.
215: * @return NewsConfig
216: */
217: public function setThumbnail(array $thumbnail)
218: {
219: $this->thumbnail = $thumbnail;
220:
221: return $this;
222: }
223:
224: /**
225: * @param string $parentSectionSlug News parent section (slug).
226: * @return NewsConfig
227: */
228: public function setParentSectionSlug($parentSectionSlug)
229: {
230: $this->parentSectionSlug = $this->translator()->translation($parentSectionSlug);
231:
232: return $this;
233: }
234: }
235: