1 | <?php |
||
24 | abstract class FormAbstract implements FormInterface |
||
25 | { |
||
26 | use LoggedUser; |
||
27 | |||
28 | /** |
||
29 | * An instance of Model. |
||
30 | * |
||
31 | * @var Model |
||
32 | */ |
||
33 | protected $model; |
||
34 | |||
35 | /** |
||
36 | * Set an instance of model currently being edited. |
||
37 | * |
||
38 | * @param Model $model |
||
39 | * |
||
40 | * @return void|FormInterface |
||
41 | */ |
||
42 | public function editingModel(Model $model) |
||
48 | 52 | ||
49 | /** |
||
50 | 52 | * Setup the object from the route parameters. |
|
51 | * |
||
52 | * @param array $params |
||
53 | * |
||
54 | * @return FormInterface |
||
55 | */ |
||
56 | public function setup(array $params) |
||
67 | |||
68 | /** |
||
69 | * Whether or not the form is in editing of a model. |
||
70 | * |
||
71 | * @return bool |
||
72 | */ |
||
73 | public function isEditing() |
||
77 | |||
78 | 13 | /** |
|
79 | * Return an instance of the model being edited. |
||
80 | * |
||
81 | * @return Model |
||
82 | */ |
||
83 | public function getModel() |
||
87 | |||
88 | /** |
||
89 | * Returns form type. |
||
90 | 26 | * |
|
91 | 4 | * @return string |
|
92 | 26 | */ |
|
93 | 26 | public function openType() |
|
97 | 26 | ||
98 | /** |
||
99 | * Returns an array of form actions. |
||
100 | * |
||
101 | * @return array |
||
102 | */ |
||
103 | public function actions() |
||
107 | 32 | ||
108 | /** |
||
109 | * Returns an array of form fields. |
||
110 | * |
||
111 | * @return array |
||
112 | */ |
||
113 | public function fields() |
||
117 | 50 | ||
118 | /** |
||
119 | * Returns an array form rules. |
||
120 | * |
||
121 | * @return array |
||
122 | */ |
||
123 | public function rules() |
||
127 | 41 | ||
128 | /** |
||
129 | * Returns the form redirect url on error. |
||
130 | * |
||
131 | * @return string |
||
132 | */ |
||
133 | public function getRedirectUrl() |
||
137 | 14 | ||
138 | /** |
||
139 | * Returns project upload fields. |
||
140 | * |
||
141 | * @param string $name |
||
142 | * @param ProjectModel $project |
||
143 | * @param UserModel $user |
||
144 | * |
||
145 | * @return array |
||
146 | */ |
||
147 | protected function projectUploadFields($name, ProjectModel $project, UserModel $user) |
||
162 | } |
||
163 |