1 | <?php |
||
13 | class EditCommentForm extends FormModel |
||
14 | { |
||
15 | /** |
||
16 | * Constructor injects with DI container and the id to update. |
||
17 | * |
||
18 | * @param Anax\DI\DIInterface $di a service container |
||
19 | * @param integer $id to update |
||
20 | */ |
||
21 | public function __construct(DIInterface $di, $id) |
||
56 | |||
57 | |||
58 | |||
59 | /** |
||
60 | * Get details on item to load form with. |
||
61 | * |
||
62 | * @param integer $id get details on item with id. |
||
63 | * |
||
64 | * @return object true if okey, false if something went wrong. |
||
65 | */ |
||
66 | public function getCommentDetails($id) |
||
73 | |||
74 | |||
75 | /** |
||
76 | * get details for the user based on sessio |
||
77 | * |
||
78 | * |
||
79 | * @return object the user |
||
80 | */ |
||
81 | public function controlAuthority() |
||
95 | |||
96 | /** |
||
97 | * Callback for submit-button which should return true if it could |
||
98 | * carry out its work and false if something failed. |
||
99 | * |
||
100 | * @return void |
||
101 | */ |
||
102 | public function callbackDelete() |
||
115 | |||
116 | /** |
||
117 | * Callback for submit-button which should return true if it could |
||
118 | * carry out its work and false if something failed. |
||
119 | * |
||
120 | * @return void |
||
121 | */ |
||
122 | public function callbackSubmit() |
||
135 | } |
||
136 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: