1 | <?php |
||
3 | abstract class Ajde_Document extends Ajde_Object_Standard |
||
4 | { |
||
5 | const CACHE_CONTROL_PUBLIC = 'public'; |
||
6 | const CACHE_CONTROL_PRIVATE = 'private'; |
||
7 | const CACHE_CONTROL_NOCACHE = 'no-cache'; |
||
8 | |||
9 | protected $_cacheControl = self::CACHE_CONTROL_PUBLIC; |
||
10 | protected $_contentType = 'text/html'; |
||
11 | protected $_maxAge = 604800; // 1 week |
||
12 | |||
13 | public function __construct() |
||
17 | |||
18 | /** |
||
19 | * @param Ajde_Core_Route $route |
||
20 | * |
||
21 | * @return Ajde_Document |
||
22 | */ |
||
23 | public static function fromRoute(Ajde_Core_Route $route) |
||
35 | |||
36 | /** |
||
37 | * @return Ajde_Layout |
||
38 | */ |
||
39 | public function setLayout(Ajde_Layout $layout) |
||
48 | |||
49 | /** |
||
50 | * @return Ajde_Layout |
||
51 | */ |
||
52 | public function getLayout() |
||
61 | |||
62 | /** |
||
63 | * @param string $contents |
||
64 | */ |
||
65 | public function setBody($contents) |
||
69 | |||
70 | /** |
||
71 | * @return string |
||
72 | */ |
||
73 | public function getBody() |
||
81 | |||
82 | public function setTitle($title) |
||
86 | |||
87 | public function getTitle() |
||
91 | |||
92 | public function getFullTitle() |
||
104 | |||
105 | public function setDescription($description) |
||
109 | |||
110 | public function getDescription() |
||
118 | |||
119 | public function setAuthor($author) |
||
123 | |||
124 | public function getAuthor() |
||
132 | |||
133 | public function render() |
||
137 | |||
138 | public function getCacheControl() |
||
142 | |||
143 | public function setCacheControl($cacheControl) |
||
147 | |||
148 | public function getContentType() |
||
152 | |||
153 | public function setContentType($mimeType) |
||
157 | |||
158 | public function getMaxAge() |
||
162 | |||
163 | public function setMaxAge($days) |
||
167 | |||
168 | /** |
||
169 | * @param Ajde_Resource $resource |
||
170 | */ |
||
171 | public function addResource(Ajde_Resource $resource) |
||
174 | |||
175 | public function getResourceTypes() |
||
178 | |||
179 | // Render helpers |
||
180 | |||
181 | /** |
||
182 | * @deprecated |
||
183 | * |
||
184 | * @throws Ajde_Core_Exception_Deprecated |
||
185 | */ |
||
186 | protected function setContentTypeHeader($contentType = null) |
||
190 | |||
191 | /** |
||
192 | * @deprecated |
||
193 | * |
||
194 | * @throws Ajde_Core_Exception_Deprecated |
||
195 | */ |
||
196 | protected function setCacheControlHeader($cacheControl = null) |
||
200 | |||
201 | public static function registerDocumentProcessor($format, $registerOn = 'layout') |
||
226 | } |
||
227 |
If you implement
__call
and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.This is often the case, when
__call
is implemented by a parent class and only the child class knows which methods exist: