| Next revision | Previous revision |
| scriptlog:lib:service:postservice [2026/09/26 09:09] – admin admin | scriptlog:lib:service:postservice [2026/09/26 09:34] (current) – admin admin |
|---|
| ======= Docblock Metadata ======= | ======= Docblock Metadata ======= |
| |
| ^ Tag ^ Value ^ | ^ Tag ^ Value ^ |
| | ''@category'' | Service class | | | ''@category'' | Service class | |
| | ''@author'' | M.Noermoehammad | | | ''@author'' | M.Noermoehammad | |
| | ''@license'' | MIT | | | ''@license'' | MIT | |
| | ''@version'' | 1.0 | | | ''@version'' | 1.0 | |
| | ''@since'' | Since Release 1.0 | | | ''@since'' | Since Release 1.0 | |
| |
| ======= Inheritance ======= | ======= Inheritance ======= |
| //None.// | //None.// |
| |
| ======= Properties (0) ======= | ======= Properties (23) ======= |
| |
| //None declared.// | ^ Visibility ^ Type ^ Name ^ Default ^ Line ^ |
| | | ''private'' | ''(untyped)'' | ''$postId'' | | 31 | |
| | | ''private'' | ''(untyped)'' | ''$post_image'' | | 37 | |
| | | ''private'' | ''(untyped)'' | ''$author'' | | 43 | |
| | | ''private'' | ''(untyped)'' | ''$post_date'' | | 49 | |
| | | ''private'' | ''(untyped)'' | ''$post_modified'' | | 57 | |
| | | ''private'' | ''(untyped)'' | ''$title'' | | 63 | |
| | | ''private'' | ''(untyped)'' | ''$slug'' | | 69 | |
| | | ''private'' | ''(untyped)'' | ''$content'' | | 75 | |
| | | ''private'' | ''(untyped)'' | ''$meta_desc'' | | 83 | |
| | | ''private'' | ''(untyped)'' | ''$post_status'' | | 91 | |
| | | ''private'' | ''(untyped)'' | ''$post_visibility'' | | 98 | |
| | | ''private'' | ''(untyped)'' | ''$post_password'' | | 105 | |
| | | ''private'' | ''(untyped)'' | ''$post_headlines'' | | 113 | |
| | | ''private'' | ''(untyped)'' | ''$comment_status'' | | 121 | |
| | | ''private'' | ''(untyped)'' | ''$passphrase'' | | 128 | |
| | | ''private'' | ''(untyped)'' | ''$topics'' | | 135 | |
| | | ''private'' | ''(untyped)'' | ''$tags'' | | 143 | |
| | | ''private'' | ''(untyped)'' | ''$post_locale'' | | 150 | |
| | | ''private'' | ''(untyped)'' | ''$postDao'' | | 158 | |
| | | ''private'' | ''(untyped)'' | ''$validator'' | | 166 | |
| | | ''private'' | ''(untyped)'' | ''$sanitizer'' | | 174 | |
| | | ''private'' | ''(untyped)'' | ''$topicDao'' | | 182 | |
| | | ''private'' | ''(untyped)'' | ''$mediaDao'' | | 190 | |
| |
| ======= Methods (49) ======= | ======= Methods (49) ======= |
| |
| ^ Visibility ^ Method ^ Summary ^ Line ^ | ^ Visibility ^ Method ^ Summary ^ Line ^ |
| | public | ''__construct()'' | Constructor | 206 | | | public | ''__construct()'' | Constructor | 206 | |
| | public | ''setPostId()'' | set post's ID | 220 | | | public | ''setPostId()'' | set post's ID | 220 | |
| | public | ''setPostImage()'' | set post's image | 231 | | | public | ''setPostImage()'' | set post's image | 231 | |
| | public | ''setPostAuthor()'' | set post's author | 242 | | | public | ''setPostAuthor()'' | set post's author | 242 | |
| | public | ''setPostDate()'' | setPostDate | 253 | | | public | ''setPostDate()'' | setPostDate | 253 | |
| | public | ''setPostModified()'' | setPostModified | 264 | | | public | ''setPostModified()'' | setPostModified | 264 | |
| | public | ''setPostTitle()'' | set post's title | 274 | | | public | ''setPostTitle()'' | set post's title | 274 | |
| | public | ''setPostSlug()'' | set post's URL SEO Friendly | 284 | | | public | ''setPostSlug()'' | set post's URL SEO Friendly | 284 | |
| | public | ''setPostContent()'' | set post's content | 295 | | | public | ''setPostContent()'' | set post's content | 295 | |
| | public | ''setMetaDesc()'' | set post's summary as meta_description tag | 305 | | | public | ''setMetaDesc()'' | set post's summary as meta_description tag | 305 | |
| | public | ''setPublish()'' | set post's status | 316 | | | public | ''setPublish()'' | set post's status | 316 | |
| | public | ''setVisibility()'' | setVisibility() | 328 | | | public | ''setVisibility()'' | setVisibility() | 328 | |
| | public | ''setProtected()'' | setProtected() | 342 | | | public | ''setProtected()'' | setProtected() | 342 | |
| | public | ''setHeadlines()'' | setHeadlines | 353 | | | public | ''setHeadlines()'' | setHeadlines | 353 | |
| | public | ''setComment()'' | set comment's status | 364 | | | public | ''setComment()'' | set comment's status | 364 | |
| | public | ''setPassPhrase()'' | setPassPhrase | 375 | | | public | ''setPassPhrase()'' | setPassPhrase | 375 | |
| | public | ''setTopics()'' | set post's topic | 386 | | | public | ''setTopics()'' | set post's topic | 386 | |
| | public | ''setPostTags()'' | setPostTags | 397 | | | public | ''setPostTags()'' | setPostTags | 397 | |
| | public | ''setPostLocale()'' | setPostLocale | 408 | | | public | ''setPostLocale()'' | setPostLocale | 408 | |
| | public | ''grabPosts()'' | Retrieve all posts. | 421 | | | public | ''grabPosts()'' | Retrieve all posts. | 421 | |
| | public | ''grabPost()'' | Retrieve a single post by ID. | 432 | | | public | ''grabPost()'' | Retrieve a single post by ID. | 432 | |
| | public | ''getPublishedPostsApi()'' | Get paginated published posts for API | 447 | | | public | ''getPublishedPostsApi()'' | Get paginated published posts for API | 447 | |
| | public | ''countPublishedPostsApi()'' | Count published posts for API | 459 | | | public | ''countPublishedPostsApi()'' | Count published posts for API | 459 | |
| | public | ''getPublishedPostApi()'' | Get a single published post by ID for API | 470 | | | public | ''getPublishedPostApi()'' | Get a single published post by ID for API | 470 | |
| | public | ''addPost()'' | Insert new post | 481 | | | public | ''addPost()'' | Insert new post | 481 | |
| | public | ''modifyPost()'' | modifyPost | 531 | | | public | ''modifyPost()'' | modifyPost | 531 | |
| | public | ''removePost()'' | removePost | 577 | | | public | ''removePost()'' | removePost | 577 | |
| | public | ''processPostImage()'' | Process post image - orchestrates default or uploaded image handling. | 648 | | | public | ''processPostImage()'' | Process post image - orchestrates default or uploaded image handling. | 648 | |
| | private | ''processDefaultImage()'' | Process default image (nophoto or existing image_id). | 672 | | | private | ''processDefaultImage()'' | Process default image (nophoto or existing image_id). | 672 | |
| | private | ''processUploadedImage()'' | Process uploaded image - handles file upload and media record. | 730 | | | private | ''processUploadedImage()'' | Process uploaded image - handles file upload and media record. | 730 | |
| | public | ''postAuthorId()'' | postAuthorId | 785 | | | public | ''postAuthorId()'' | postAuthorId | 785 | |
| | public | ''postAuthorLevel()'' | postAuthorLevel | 803 | | | public | ''postAuthorLevel()'' | postAuthorLevel | 803 | |
| | public | ''totalPosts()'' | Total posts records. | 815 | | | public | ''totalPosts()'' | Total posts records. | 815 | |
| | public | ''getArchiveIndexApi()'' | Get archive index (distinct year/month with post counts). | 827 | | | public | ''getArchiveIndexApi()'' | Get archive index (distinct year/month with post counts). | 827 | |
| | public | ''getPostsByYearApi()'' | Get published posts by year for API. | 842 | | | public | ''getPostsByYearApi()'' | Get published posts by year for API. | 842 | |
| | public | ''countPostsByYearApi()'' | Count published posts by year for API. | 854 | | | public | ''countPostsByYearApi()'' | Count published posts by year for API. | 854 | |
| | public | ''getPostsByYearMonthApi()'' | Get published posts by year and month for API. | 870 | | | public | ''getPostsByYearMonthApi()'' | Get published posts by year and month for API. | 870 | |
| | public | ''countPostsByYearMonthApi()'' | Count published posts by year and month for API. | 883 | | | public | ''countPostsByYearMonthApi()'' | Count published posts by year and month for API. | 883 | |
| | public | ''searchPostsApi()'' | Search posts by keyword for API query endpoint. | 896 | | | public | ''searchPostsApi()'' | Search posts by keyword for API query endpoint. | 896 | |
| | public | ''getPostTopicsApi()'' | Get topics for a post. | 907 | | | public | ''getPostTopicsApi()'' | Get topics for a post. | 907 | |
| | public | ''setPostTopicsApi()'' | Set topic relationships for a post. | 919 | | | public | ''setPostTopicsApi()'' | Set topic relationships for a post. | 919 | |
| | public | ''createPostApi()'' | Create a post for the API and return the new ID. | 930 | | | public | ''createPostApi()'' | Create a post for the API and return the new ID. | 930 | |
| | public | ''updatePostApi()'' | Update a post with dynamic fields for the API. | 942 | | | public | ''updatePostApi()'' | Update a post with dynamic fields for the API. | 942 | |
| | public | ''removePostApi()'' | Delete a post and all related data. | 953 | | | public | ''removePostApi()'' | Delete a post and all related data. | 953 | |
| | public | ''getPostByIdApi()'' | Get a post by ID (any status). | 966 | | | public | ''getPostByIdApi()'' | Get a post by ID (any status). | 966 | |
| | public | ''getFeaturedMediaApi()'' | Get featured media row for the API. | 980 | | | public | ''getFeaturedMediaApi()'' | Get featured media row for the API. | 980 | |
| | public | ''getTopicCheckboxes()'' | Get topic checkboxes for the post form. | 996 | | | public | ''getTopicCheckboxes()'' | Get topic checkboxes for the post form. | 996 | |
| | public | ''getMediaDropdown()'' | Get media dropdown for the post form. | 1010 | | | public | ''getMediaDropdown()'' | Get media dropdown for the post form. | 1010 | |
| | public | ''getMediaUploadField()'' | Get media upload field for the post form. | 1024 | | | public | ''getMediaUploadField()'' | Get media upload field for the post form. | 1024 | |
| |
| |
| working; the admin composition root passes them explicitly. | working; the admin composition root passes them explicitly. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$postDao'' | [[scriptlog:lib:dao:postdao|''PostDao'']] | //required// | //none// | | | ''$postDao'' | [[scriptlog:lib:dao:postdao|''PostDao'']] | //required// | //none// | |
| | ''$validator'' | [[scriptlog:lib:core:formvalidator|''FormValidator'']] | //required// | //none// | | | ''$validator'' | [[scriptlog:lib:core:formvalidator|''FormValidator'']] | //required// | //none// | |
| | ''$sanitizer'' | [[scriptlog:lib:core:sanitize|''Sanitize'']] | //required// | //none// | | | ''$sanitizer'' | [[scriptlog:lib:core:sanitize|''Sanitize'']] | //required// | //none// | |
| | ''$topicDao'' | [[scriptlog:lib:dao:topicdao|''?TopicDao'']] | ''null'' | Data access for post category lookups and writes | | | ''$topicDao'' | [[scriptlog:lib:dao:topicdao|''?TopicDao'']] | ''null'' | Data access for post category lookups and writes | |
| | ''$mediaDao'' | [[scriptlog:lib:dao:mediadao|''?MediaDao'']] | ''null'' | Data access for post media lookups and writes | | | ''$mediaDao'' | [[scriptlog:lib:dao:mediadao|''?MediaDao'']] | ''null'' | Data access for post media lookups and writes | |
| |
| |
| set post's ID | set post's ID |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$postId'' | ''(untyped)'' | //required// | //none// | | | ''$postId'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' | **Returns:** ''(none declared)'' |
| set post's image | set post's image |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$post_image'' | ''(untyped)'' | //required// | //none// | | | ''$post_image'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' | **Returns:** ''(none declared)'' |
| set post's author | set post's author |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$author'' | ''(untyped)'' | //required// | //none// | | | ''$author'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' | **Returns:** ''(none declared)'' |
| setPostDate | setPostDate |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$date_created'' | ''(untyped)'' | //required// | //none// | | | ''$date_created'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' | **Returns:** ''(none declared)'' |
| setPostModified | setPostModified |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$date_modified'' | ''(untyped)'' | //required// | //none// | | | ''$date_modified'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' | **Returns:** ''(none declared)'' |
| set post's title | set post's title |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$title'' | ''(untyped)'' | //required// | //none// | | | ''$title'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' | **Returns:** ''(none declared)'' |
| set post's URL SEO Friendly | set post's URL SEO Friendly |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$slug'' | ''(untyped)'' | //required// | //none// | | | ''$slug'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' | **Returns:** ''(none declared)'' |
| set post's content | set post's content |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$content'' | ''(untyped)'' | //required// | //none// | | | ''$content'' | ''(untyped)'' | //required// | //none// | |
| | ''$skipPurify'' | ''(untyped)'' | ''false'' | //none// | | | ''$skipPurify'' | ''(untyped)'' | ''false'' | //none// | |
| |
| **Returns:** ''(none declared)'' | **Returns:** ''(none declared)'' |
| set post's summary as meta_description tag | set post's summary as meta_description tag |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$meta_desc'' | ''(untyped)'' | //required// | //none// | | | ''$meta_desc'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' | **Returns:** ''(none declared)'' |
| published or save as draft | published or save as draft |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$post_status'' | ''(untyped)'' | //required// | //none// | | | ''$post_status'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' | **Returns:** ''(none declared)'' |
| setup post visibility whether is public, private or protected with password | setup post visibility whether is public, private or protected with password |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$post_visibility'' | ''(untyped)'' | //required// | //none// | | | ''$post_visibility'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' | **Returns:** ''(none declared)'' |
| someone know its password only can read whole post protected | someone know its password only can read whole post protected |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$post_password'' | ''(untyped)'' | //required// | //none// | | | ''$post_password'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' | **Returns:** ''(none declared)'' |
| setHeadlines | setHeadlines |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$post_headlines'' | ''(untyped)'' | //required// | //none// | | | ''$post_headlines'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' | **Returns:** ''(none declared)'' |
| comment allowed(open) or not allowed(close) | comment allowed(open) or not allowed(close) |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$comment_status'' | ''(untyped)'' | //required// | //none// | | | ''$comment_status'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' | **Returns:** ''(none declared)'' |
| setPassPhrase | setPassPhrase |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$passphrase'' | ''(untyped)'' | //required// | //none// | | | ''$passphrase'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' | **Returns:** ''(none declared)'' |
| set post's topic | set post's topic |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$topics'' | ''(untyped)'' | //required// | //none// | | | ''$topics'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' | **Returns:** ''(none declared)'' |
| setPostTags | setPostTags |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$tags'' | ''(untyped)'' | //required// | //none// | | | ''$tags'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' | **Returns:** ''(none declared)'' |
| setPostLocale | setPostLocale |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$post_locale'' | ''(untyped)'' | //required// | //none// | | | ''$post_locale'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' | **Returns:** ''(none declared)'' |
| Retrieve all posts. | Retrieve all posts. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$orderBy'' | ''(untyped)'' | '''ID''' | //none// | | | ''$orderBy'' | ''(untyped)'' | '''ID''' | //none// | |
| | ''$author'' | ''(untyped)'' | ''null'' | //none// | | | ''$author'' | ''(untyped)'' | ''null'' | //none// | |
| |
| **Returns:** ''(none declared)'' — array|bool|object | **Returns:** ''(none declared)'' — array|bool|object |
| Retrieve a single post by ID. | Retrieve a single post by ID. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$postId'' | ''(untyped)'' | //required// | //none// | | | ''$postId'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — array|bool|object | **Returns:** ''(none declared)'' — array|bool|object |
| Get paginated published posts for API | Get paginated published posts for API |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$page'' | ''(untyped)'' | ''1'' | //none// | | | ''$page'' | ''(untyped)'' | ''1'' | //none// | |
| | ''$perPage'' | ''(untyped)'' | ''10'' | //none// | | | ''$perPage'' | ''(untyped)'' | ''10'' | //none// | |
| | ''$sortBy'' | ''(untyped)'' | '''ID''' | //none// | | | ''$sortBy'' | ''(untyped)'' | '''ID''' | //none// | |
| | ''$sortOrder'' | ''(untyped)'' | '''DESC''' | //none// | | | ''$sortOrder'' | ''(untyped)'' | '''DESC''' | //none// | |
| | ''$author'' | ''(untyped)'' | ''null'' | //none// | | | ''$author'' | ''(untyped)'' | ''null'' | //none// | |
| |
| **Returns:** ''(none declared)'' — array | **Returns:** ''(none declared)'' — array |
| Count published posts for API | Count published posts for API |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$author'' | ''(untyped)'' | ''null'' | //none// | | | ''$author'' | ''(untyped)'' | ''null'' | //none// | |
| |
| **Returns:** ''(none declared)'' — integer | **Returns:** ''(none declared)'' — integer |
| Get a single published post by ID for API | Get a single published post by ID for API |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$postId'' | ''(untyped)'' | //required// | //none// | | | ''$postId'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — array|false | **Returns:** ''(none declared)'' — array|false |
| Process post image - orchestrates default or uploaded image handling. | Process post image - orchestrates default or uploaded image handling. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$file_location'' | ''(untyped)'' | //required// | //none// | | | ''$file_location'' | ''(untyped)'' | //required// | //none// | |
| | ''$file_type'' | ''(untyped)'' | //required// | //none// | | | ''$file_type'' | ''(untyped)'' | //required// | //none// | |
| | ''$file_name'' | ''(untyped)'' | //required// | //none// | | | ''$file_name'' | ''(untyped)'' | //required// | //none// | |
| | ''$file_size'' | ''(untyped)'' | //required// | //none// | | | ''$file_size'' | ''(untyped)'' | //required// | //none// | |
| | ''$file_extension'' | ''(untyped)'' | //required// | //none// | | | ''$file_extension'' | ''(untyped)'' | //required// | //none// | |
| | ''$new_filename'' | ''(untyped)'' | //required// | //none// | | | ''$new_filename'' | ''(untyped)'' | //required// | //none// | |
| | ''$width'' | ''(untyped)'' | //required// | //none// | | | ''$width'' | ''(untyped)'' | //required// | //none// | |
| | ''$height'' | ''(untyped)'' | //required// | //none// | | | ''$height'' | ''(untyped)'' | //required// | //none// | |
| | ''$media_access'' | ''(untyped)'' | //required// | //none// | | | ''$media_access'' | ''(untyped)'' | //required// | //none// | |
| | ''$user_level'' | ''(untyped)'' | //required// | //none// | | | ''$user_level'' | ''(untyped)'' | //required// | //none// | |
| | ''$filtered'' | ''array'' | //required// | //none// | | | ''$filtered'' | ''array'' | //required// | //none// | |
| | ''$isUpdate'' | ''(untyped)'' | ''false'' | //none// | | | ''$isUpdate'' | ''(untyped)'' | ''false'' | //none// | |
| | ''$oldMediaId'' | ''(untyped)'' | ''null'' | //none// | | | ''$oldMediaId'' | ''(untyped)'' | ''null'' | //none// | |
| |
| **Returns:** ''(none declared)'' — void | **Returns:** ''(none declared)'' — void |
| Process default image (nophoto or existing image_id). | Process default image (nophoto or existing image_id). |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$filtered'' | ''array'' | //required// | //none// | | | ''$filtered'' | ''array'' | //required// | //none// | |
| | ''$width'' | ''(untyped)'' | //required// | //none// | | | ''$width'' | ''(untyped)'' | //required// | //none// | |
| | ''$height'' | ''(untyped)'' | //required// | //none// | | | ''$height'' | ''(untyped)'' | //required// | //none// | |
| | ''$media_access'' | ''(untyped)'' | //required// | //none// | | | ''$media_access'' | ''(untyped)'' | //required// | //none// | |
| | ''$user_level'' | ''(untyped)'' | //required// | //none// | | | ''$user_level'' | ''(untyped)'' | //required// | //none// | |
| | ''$isUpdate'' | ''(untyped)'' | ''false'' | //none// | | | ''$isUpdate'' | ''(untyped)'' | ''false'' | //none// | |
| |
| **Returns:** ''(none declared)'' — int|null | **Returns:** ''(none declared)'' — int|null |
| Process uploaded image - handles file upload and media record. | Process uploaded image - handles file upload and media record. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$file_location'' | ''(untyped)'' | //required// | //none// | | | ''$file_location'' | ''(untyped)'' | //required// | //none// | |
| | ''$file_type'' | ''(untyped)'' | //required// | //none// | | | ''$file_type'' | ''(untyped)'' | //required// | //none// | |
| | ''$file_name'' | ''(untyped)'' | //required// | //none// | | | ''$file_name'' | ''(untyped)'' | //required// | //none// | |
| | ''$file_size'' | ''(untyped)'' | //required// | //none// | | | ''$file_size'' | ''(untyped)'' | //required// | //none// | |
| | ''$file_extension'' | ''(untyped)'' | //required// | //none// | | | ''$file_extension'' | ''(untyped)'' | //required// | //none// | |
| | ''$new_filename'' | ''(untyped)'' | //required// | //none// | | | ''$new_filename'' | ''(untyped)'' | //required// | //none// | |
| | ''$width'' | ''(untyped)'' | //required// | //none// | | | ''$width'' | ''(untyped)'' | //required// | //none// | |
| | ''$height'' | ''(untyped)'' | //required// | //none// | | | ''$height'' | ''(untyped)'' | //required// | //none// | |
| | ''$media_access'' | ''(untyped)'' | //required// | //none// | | | ''$media_access'' | ''(untyped)'' | //required// | //none// | |
| | ''$user_level'' | ''(untyped)'' | //required// | //none// | | | ''$user_level'' | ''(untyped)'' | //required// | //none// | |
| | ''$filtered'' | ''array'' | //required// | //none// | | | ''$filtered'' | ''array'' | //required// | //none// | |
| | ''$oldMediaId'' | ''(untyped)'' | ''null'' | //none// | | | ''$oldMediaId'' | ''(untyped)'' | ''null'' | //none// | |
| |
| **Returns:** ''(none declared)'' — void | **Returns:** ''(none declared)'' — void |
| Total posts records. | Total posts records. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$data'' | ''array'' | ''[]'' | Optional list where the first element is the author ID. | | | ''$data'' | ''array'' | ''[]'' | Optional list where the first element is the author ID. | |
| |
| **Returns:** ''?int'' — int|null | **Returns:** ''?int'' — int|null |
| Get published posts by year for API. | Get published posts by year for API. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$year'' | ''(untyped)'' | //required// | //none// | | | ''$year'' | ''(untyped)'' | //required// | //none// | |
| | ''$page'' | ''(untyped)'' | ''1'' | //none// | | | ''$page'' | ''(untyped)'' | ''1'' | //none// | |
| | ''$perPage'' | ''(untyped)'' | ''10'' | //none// | | | ''$perPage'' | ''(untyped)'' | ''10'' | //none// | |
| | ''$sortBy'' | ''(untyped)'' | '''ID''' | //none// | | | ''$sortBy'' | ''(untyped)'' | '''ID''' | //none// | |
| | ''$sortOrder'' | ''(untyped)'' | '''DESC''' | //none// | | | ''$sortOrder'' | ''(untyped)'' | '''DESC''' | //none// | |
| |
| **Returns:** ''(none declared)'' — array | **Returns:** ''(none declared)'' — array |
| Count published posts by year for API. | Count published posts by year for API. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$year'' | ''(untyped)'' | //required// | //none// | | | ''$year'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — int | **Returns:** ''(none declared)'' — int |
| Get published posts by year and month for API. | Get published posts by year and month for API. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$year'' | ''(untyped)'' | //required// | //none// | | | ''$year'' | ''(untyped)'' | //required// | //none// | |
| | ''$month'' | ''(untyped)'' | //required// | //none// | | | ''$month'' | ''(untyped)'' | //required// | //none// | |
| | ''$page'' | ''(untyped)'' | ''1'' | //none// | | | ''$page'' | ''(untyped)'' | ''1'' | //none// | |
| | ''$perPage'' | ''(untyped)'' | ''10'' | //none// | | | ''$perPage'' | ''(untyped)'' | ''10'' | //none// | |
| | ''$sortBy'' | ''(untyped)'' | '''ID''' | //none// | | | ''$sortBy'' | ''(untyped)'' | '''ID''' | //none// | |
| | ''$sortOrder'' | ''(untyped)'' | '''DESC''' | //none// | | | ''$sortOrder'' | ''(untyped)'' | '''DESC''' | //none// | |
| |
| **Returns:** ''(none declared)'' — array | **Returns:** ''(none declared)'' — array |
| Count published posts by year and month for API. | Count published posts by year and month for API. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$year'' | ''(untyped)'' | //required// | //none// | | | ''$year'' | ''(untyped)'' | //required// | //none// | |
| | ''$month'' | ''(untyped)'' | //required// | //none// | | | ''$month'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — int | **Returns:** ''(none declared)'' — int |
| Search posts by keyword for API query endpoint. | Search posts by keyword for API query endpoint. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$keyword'' | ''(untyped)'' | //required// | //none// | | | ''$keyword'' | ''(untyped)'' | //required// | //none// | |
| | ''$type'' | ''(untyped)'' | '''all''' | 'blog', 'page', or 'all' | | | ''$type'' | ''(untyped)'' | '''all''' | 'blog', 'page', or 'all' | |
| | ''$limit'' | ''(untyped)'' | ''50'' | //none// | | | ''$limit'' | ''(untyped)'' | ''50'' | //none// | |
| |
| **Returns:** ''(none declared)'' — array | **Returns:** ''(none declared)'' — array |
| Get topics for a post. | Get topics for a post. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$postId'' | ''(untyped)'' | //required// | //none// | | | ''$postId'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — array | **Returns:** ''(none declared)'' — array |
| Set topic relationships for a post. | Set topic relationships for a post. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$postId'' | ''(untyped)'' | //required// | //none// | | | ''$postId'' | ''(untyped)'' | //required// | //none// | |
| | ''$topicIds'' | ''(untyped)'' | //required// | //none// | | | ''$topicIds'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — void | **Returns:** ''(none declared)'' — void |
| Create a post for the API and return the new ID. | Create a post for the API and return the new ID. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$data'' | ''array'' | //required// | //none// | | | ''$data'' | ''array'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — int | **Returns:** ''(none declared)'' — int |
| Update a post with dynamic fields for the API. | Update a post with dynamic fields for the API. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$postId'' | ''(untyped)'' | //required// | //none// | | | ''$postId'' | ''(untyped)'' | //required// | //none// | |
| | ''$data'' | ''array'' | //required// | //none// | | | ''$data'' | ''array'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — void | **Returns:** ''(none declared)'' — void |
| Delete a post and all related data. | Delete a post and all related data. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$postId'' | ''(untyped)'' | //required// | //none// | | | ''$postId'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — void | **Returns:** ''(none declared)'' — void |
| Get a post by ID (any status). | Get a post by ID (any status). |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$postId'' | ''(untyped)'' | //required// | //none// | | | ''$postId'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — array|false | **Returns:** ''(none declared)'' — array|false |
| never receive false or boolean true. | never receive false or boolean true. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$mediaId'' | ''(untyped)'' | //required// | //none// | | | ''$mediaId'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''?array'' — array|null Media row or null when missing | **Returns:** ''?array'' — array|null Media row or null when missing |
| objects. | objects. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$postId'' | ''(untyped)'' | ''null'' | Post ID to pre-check, null for new posts | | | ''$postId'' | ''(untyped)'' | ''null'' | Post ID to pre-check, null for new posts | |
| |
| **Returns:** ''string'' — string Checkbox HTML | **Returns:** ''string'' — string Checkbox HTML |
| objects. | objects. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$selected'' | ''(untyped)'' | ''null'' | Media ID pre-selected in the list | | | ''$selected'' | ''(untyped)'' | ''null'' | Media ID pre-selected in the list | |
| |
| **Returns:** ''string'' — string Dropdown HTML | **Returns:** ''string'' — string Dropdown HTML |
| objects. | objects. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$mediaId'' | ''(untyped)'' | ''null'' | Current media ID for existing posts | | | ''$mediaId'' | ''(untyped)'' | ''null'' | Current media ID for existing posts | |
| |
| **Returns:** ''string'' — string Upload field HTML | **Returns:** ''string'' — string Upload field HTML |
| ======= Imports ======= | ======= Imports ======= |
| |
| ^ Alias ^ Fully-qualified name ^ | ^ Alias ^ Fully-qualified name ^ |
| | ''FormValidator'' | [[scriptlog:lib:core:formvalidator|''Scriptlog\Core\FormValidator'']] | | | ''FormValidator'' | [[scriptlog:lib:core:formvalidator|''Scriptlog\Core\FormValidator'']] | |
| | ''Sanitize'' | [[scriptlog:lib:core:sanitize|''Scriptlog\Core\Sanitize'']] | | | ''Sanitize'' | [[scriptlog:lib:core:sanitize|''Scriptlog\Core\Sanitize'']] | |
| | ''Session'' | [[scriptlog:lib:core:session|''Scriptlog\Core\Session'']] | | | ''Session'' | [[scriptlog:lib:core:session|''Scriptlog\Core\Session'']] | |
| | ''MediaDao'' | [[scriptlog:lib:dao:mediadao|''Scriptlog\Dao\MediaDao'']] | | | ''MediaDao'' | [[scriptlog:lib:dao:mediadao|''Scriptlog\Dao\MediaDao'']] | |
| | ''PostDao'' | [[scriptlog:lib:dao:postdao|''Scriptlog\Dao\PostDao'']] | | | ''PostDao'' | [[scriptlog:lib:dao:postdao|''Scriptlog\Dao\PostDao'']] | |
| | ''TopicDao'' | [[scriptlog:lib:dao:topicdao|''Scriptlog\Dao\TopicDao'']] | | | ''TopicDao'' | [[scriptlog:lib:dao:topicdao|''Scriptlog\Dao\TopicDao'']] | |
| |
| |