====== PostController ======
**Layer:** ''Controller'' · **Source:** ''lib/controller/PostController.php:32'' (lines 32–418)
----
final class PostController extends BaseApp
======= Docblock Metadata =======
^ Tag ^ Value ^
| ''@category'' | Class PostController extends BaseApp |
| ''@author'' | M.Noermoehammad |
| ''@license'' | MIT |
| ''@version'' | 1.0 |
| ''@since'' | Since Release 1.0 |
======= Inheritance =======
^ Relation ^ Type ^ Meaning ^
| extends | [[scriptlog:lib:core:baseapp|''BaseApp'']] | parent class/interface |
======= Constants (0) =======
//None.//
======= Properties (3) =======
^ Visibility ^ Type ^ Name ^ Default ^ Line ^
| ''private'' | ''(untyped)'' | ''$view'' | | 34 |
| ''private'' | ''(untyped)'' | ''$postService'' | | 36 |
| ''private'' | ''(untyped)'' | ''$appService'' | | 38 |
======= Methods (13) =======
^ 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 |
======== __construct() ========
public function __construct(PostService $postService, PostApplicationService $appService)
//lines 40–44 (5)//
^ Parameter ^ Type ^ Default ^ Description ^
| ''$postService'' | [[scriptlog:lib:service:postservice|''PostService'']] | //required// | //none// |
| ''$appService'' | [[scriptlog:lib:service:postapplicationservice|''PostApplicationService'']] | //required// | //none// |
======== listItems() ========
public function listItems()
//lines 51–94 (44)//
Documentation inherited from [[scriptlog:lib:core:baseapp|''Scriptlog\Core\BaseApp'']].
abstract method list items
//Takes no parameters.//
**Returns:** ''(none declared)''
======== insert() ========
public function insert()
//lines 101–141 (41)//
Create a new post.
//Takes no parameters.//
**Returns:** ''(none declared)'' — string
======== update() ========
public function update($id)
//lines 149–216 (68)//
Update an existing post.
^ Parameter ^ Type ^ Default ^ Description ^
| ''$id'' | ''(untyped)'' | //required// | //none// |
**Returns:** ''(none declared)'' — string
======== remove() ========
public function remove($id)
//lines 224–251 (28)//
Documentation inherited from [[scriptlog:lib:core:baseapp|''Scriptlog\Core\BaseApp'']].
Abstract method remove
^ Parameter ^ Type ^ Default ^ Description ^
| ''$id'' | ''(untyped)'' | //required// | //none// |
**Returns:** ''(none declared)''
======== checkPostCsrf() ========
private function checkPostCsrf()
//lines 255–262 (8)//
//Takes no parameters.//
**Returns:** ''(none declared)''
======== checkPostPayload() ========
private function checkPostPayload()
//lines 264–272 (9)//
//Takes no parameters.//
**Returns:** ''(none declared)''
======== checkPostUpdatePayload() ========
private function checkPostUpdatePayload()
//lines 274–282 (9)//
//Takes no parameters.//
**Returns:** ''(none declared)''
======== validatePostSubmission() ========
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)''
======== validatePostUpdate() ========
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)''
======== renderNewPostForm() ========
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)''
======== renderEditPostForm() ========
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)''
======== setView() ========
protected function setView($viewName)
//lines 414–417 (4)//
Set view.
^ Parameter ^ Type ^ Default ^ Description ^
| ''$viewName'' | ''(untyped)'' | //required// | //none// |
**Returns:** ''(none declared)'' — void
======= Imports =======
^ Alias ^ Fully-qualified name ^
| ''ActionConst'' | [[scriptlog:lib:core:actionconst|''Scriptlog\Core\ActionConst'']] |
| ''AppException'' | [[scriptlog:lib:core:appexception|''Scriptlog\Core\AppException'']] |
| ''BaseApp'' | [[scriptlog:lib:core:baseapp|''Scriptlog\Core\BaseApp'']] |
| ''LogError'' | [[scriptlog:lib:core:logerror|''Scriptlog\Core\LogError'']] |
| ''View'' | [[scriptlog:lib:core:view|''Scriptlog\Core\View'']] |
| ''PostRequestDto'' | [[scriptlog:lib:dto:postrequestdto|''Scriptlog\Dto\PostRequestDto'']] |
| ''UploadedFileDto'' | [[scriptlog:lib:dto:uploadedfiledto|''Scriptlog\Dto\UploadedFileDto'']] |
| ''PostApplicationService'' | [[scriptlog:lib:service:postapplicationservice|''Scriptlog\Service\PostApplicationService'']] |
| ''PostService'' | [[scriptlog:lib:service:postservice|''Scriptlog\Service\PostService'']] |
| ''FileUploadValidator'' | [[scriptlog:lib:validator:fileuploadvalidator|''Scriptlog\Validator\FileUploadValidator'']] |
| ''PostValidator'' | [[scriptlog:lib:validator:postvalidator|''Scriptlog\Validator\PostValidator'']] |
| ''ProtectedPostValidator'' | [[scriptlog:lib:validator:protectedpostvalidator|''Scriptlog\Validator\ProtectedPostValidator'']] |
----
//This page is generated from source by 'tools/gendoc'. Edits will be overwritten.//