| Total Complexity | 4 |
| Total Lines | 48 |
| Duplicated Lines | 0 % |
| Coverage | 25% |
| Changes | 0 | ||
| 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 | * |
||
| 23 | * @var array |
||
| 24 | */ |
||
| 25 | public static $ratings = null; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Returns the unique ID for this status to be used in HTML |
||
| 29 | * |
||
| 30 | * @return string |
||
| 31 | */ |
||
| 32 | 1 | public function getUniqueId() |
|
| 33 | { |
||
| 34 | 1 | return $this->idMovie . '_' . $this->idUser; |
|
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Returns the name |
||
| 39 | * |
||
| 40 | * @return string |
||
| 41 | */ |
||
| 42 | public function getName() |
||
| 43 | { |
||
| 44 | if ($this->rating == 0) { |
||
| 45 | return _tr('Not rated'); |
||
| 46 | } |
||
| 47 | |||
| 48 | return self::$ratings[$this->rating]; |
||
| 49 | } |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Returns the date of last update |
||
| 53 | * |
||
| 54 | * @return Zend_Date |
||
| 55 | */ |
||
| 56 | public function getDateUpdate() |
||
| 59 | } |
||
| 60 | } |
||
| 61 | |||
| 70 |