| 1 | <?php |
||
| 9 | class Comment extends ActiveRecordModel |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var string $tableName name of the database table. |
||
| 13 | */ |
||
| 14 | protected $tableName = "c_comments"; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Columns in the table. |
||
| 18 | * |
||
| 19 | * @var integer $id primary key auto incremented. |
||
| 20 | */ |
||
| 21 | public $id; |
||
| 22 | public $userId; |
||
| 23 | public $userMail; |
||
| 24 | public $msg; |
||
| 25 | public $heading; |
||
| 26 | public $postDate; |
||
| 27 | public $deleted; |
||
| 28 | public $updated; |
||
| 29 | public $liked; |
||
| 30 | |||
| 31 | |||
| 32 | /** |
||
| 33 | * Inits the object with the dabase |
||
| 34 | */ |
||
| 35 | 5 | public function init($db) |
|
| 39 | |||
| 40 | /** |
||
| 41 | * Gets all comments from Db |
||
| 42 | */ |
||
| 43 | 1 | public function getComments() |
|
| 47 | |||
| 48 | /** |
||
| 49 | * Gets all comments from Db |
||
| 50 | */ |
||
| 51 | 1 | public function getComment($index) |
|
| 55 | |||
| 56 | |||
| 57 | /** |
||
| 58 | * Delete comment with a specific ID |
||
| 59 | */ |
||
| 60 | 1 | public function deleteComment($index) |
|
| 65 | |||
| 66 | |||
| 67 | /** |
||
| 68 | * @return string |
||
| 69 | * Get the avatar HTML |
||
| 70 | */ |
||
| 71 | 1 | public function getAvatar($index, $classes = "", $size = 125) |
|
| 79 | } |
||
| 80 |