1 | <?php |
||
11 | class Status extends AbstractModel |
||
12 | { |
||
13 | const Nothing = 0; |
||
14 | const Need = 1; |
||
15 | const Bad = 2; |
||
16 | const Ok = 3; |
||
17 | const Excellent = 4; |
||
18 | const Favorite = 5; |
||
19 | |||
20 | /** |
||
21 | * array of ratings names indexed by the rating value |
||
22 | * @var array |
||
23 | */ |
||
24 | public static $ratings = null; |
||
25 | |||
26 | /** |
||
27 | * Returns the unique ID for this status to be used in HTML |
||
28 | * @return string |
||
29 | */ |
||
30 | 1 | public function getUniqueId() |
|
34 | |||
35 | /** |
||
36 | * Returns the name |
||
37 | * @return string |
||
38 | */ |
||
39 | public function getName() |
||
47 | |||
48 | /** |
||
49 | * Returns the date of last udpate |
||
50 | * @return Zend_Date |
||
51 | */ |
||
52 | public function getDateUpdate() |
||
56 | } |
||
57 | |||
65 |
The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.
The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.
To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.