Layer: Controller · Source: lib/controller/PostController.php:32 (lines 32–418)
final class PostController extends BaseApp
| Tag | Value |
|---|---|
@category | Class PostController extends BaseApp |
@author | M.Noermoehammad |
@license | MIT |
@version | 1.0 |
@since | Since Release 1.0 |
| Relation | Type | Meaning |
|---|---|---|
| extends | ''BaseApp'' | parent class/interface |
None.
| Visibility | Type | Name | Default | Line |
|---|---|---|---|---|
private | (untyped) | $view | 34 | |
private | (untyped) | $postService | 36 | |
private | (untyped) | $appService | 38 |
| Visibility | Method | Summary | Line |
|---|---|---|---|
| public | __construct() | (undocumented) | 40 |
| public | listItems() | abstract method list items | 51 |
| public | insert() | Create a new post. | 101 |
| public | update() | Update an existing post. | 149 |
| public | remove() | Abstract method remove | 224 |
| private | checkPostCsrf() | (undocumented) | 255 |
| private | checkPostPayload() | (undocumented) | 264 |
| private | checkPostUpdatePayload() | (undocumented) | 274 |
| private | validatePostSubmission() | (undocumented) | 286 |
| private | validatePostUpdate() | (undocumented) | 315 |
| private | renderNewPostForm() | (undocumented) | 338 |
| private | renderEditPostForm() | (undocumented) | 371 |
| protected | setView() | Set view. | 414 |
public function __construct(PostService $postService, PostApplicationService $appService)
lines 40–44 (5)
| Parameter | Type | Default | Description |
|---|---|---|---|
$postService | ''PostService'' | required | none |
$appService | ''PostApplicationService'' | required | none |
public function listItems()
lines 51–94 (44)
Documentation inherited from ''Scriptlog\Core\BaseApp''.
abstract method list items
Takes no parameters.
Returns: (none declared)
public function insert()
lines 101–141 (41)
Create a new post.
Takes no parameters.
Returns: (none declared) — string
public function update($id)
lines 149–216 (68)
Update an existing post.
| Parameter | Type | Default | Description |
|---|---|---|---|
$id | (untyped) | required | none |
Returns: (none declared) — string
public function remove($id)
lines 224–251 (28)
Documentation inherited from ''Scriptlog\Core\BaseApp''.
Abstract method remove
| Parameter | Type | Default | Description |
|---|---|---|---|
$id | (untyped) | required | none |
Returns: (none declared)
private function checkPostCsrf()
lines 255–262 (8)
Takes no parameters.
Returns: (none declared)
private function checkPostPayload()
lines 264–272 (9)
Takes no parameters.
Returns: (none declared)
private function checkPostUpdatePayload()
lines 274–282 (9)
Takes no parameters.
Returns: (none declared)
private function validatePostSubmission($file_location, $file_error, $file_size, $file_name, &$errors, $checkError)
lines 286–313 (28)
| Parameter | Type | Default | Description |
|---|---|---|---|
$file_location | (untyped) | required | none |
$file_error | (untyped) | required | none |
$file_size | (untyped) | required | none |
$file_name | (untyped) | required | none |
$errors (by reference) | (untyped) | required | none |
$checkError | (untyped) | required | none |
Returns: (none declared)
private function validatePostUpdate($file_location, $file_error, $file_size, $file_name, &$errors, $checkError)
lines 315–334 (20)
| Parameter | Type | Default | Description |
|---|---|---|---|
$file_location | (untyped) | required | none |
$file_error | (untyped) | required | none |
$file_size | (untyped) | required | none |
$file_name | (untyped) | required | none |
$errors (by reference) | (untyped) | required | none |
$checkError | (untyped) | required | none |
Returns: (none declared)
private function renderNewPostForm($errors, $formData, $user_level)
lines 338–369 (32)
| Parameter | Type | Default | Description |
|---|---|---|---|
$errors | (untyped) | required | none |
$formData | (untyped) | required | none |
$user_level | (untyped) | required | none |
Returns: (none declared)
private function renderEditPostForm($errors, $data_post, $getPost, $user_level)
lines 371–406 (36)
| Parameter | Type | Default | Description |
|---|---|---|---|
$errors | (untyped) | required | none |
$data_post | (untyped) | required | none |
$getPost | (untyped) | required | none |
$user_level | (untyped) | required | none |
Returns: (none declared)
protected function setView($viewName)
lines 414–417 (4)
Set view.
| Parameter | Type | Default | Description |
|---|---|---|---|
$viewName | (untyped) | required | none |
Returns: (none declared) — void
| Alias | Fully-qualified name |
|---|---|
ActionConst | ''Scriptlog\Core\ActionConst'' |
AppException | ''Scriptlog\Core\AppException'' |
BaseApp | ''Scriptlog\Core\BaseApp'' |
LogError | ''Scriptlog\Core\LogError'' |
View | ''Scriptlog\Core\View'' |
PostRequestDto | ''Scriptlog\Dto\PostRequestDto'' |
UploadedFileDto | ''Scriptlog\Dto\UploadedFileDto'' |
PostApplicationService | ''Scriptlog\Service\PostApplicationService'' |
PostService | ''Scriptlog\Service\PostService'' |
FileUploadValidator | ''Scriptlog\Validator\FileUploadValidator'' |
PostValidator | ''Scriptlog\Validator\PostValidator'' |
ProtectedPostValidator | ''Scriptlog\Validator\ProtectedPostValidator'' |
This page is generated from source by 'tools/gendoc'. Edits will be overwritten.