====== ExportService ====== **Layer:** ''Service'' · **Source:** ''lib/service/ExportService.php:29'' (lines 29–399) ---- class ExportService ExportService Main service for handling content export to various platforms ======= Docblock Metadata ======= ^ Tag ^ Value ^ | ''@category'' | Service Class | | ''@author'' | M.Noermoehammad | | ''@license'' | MIT | | ''@version'' | 1.0 | | ''@since'' | Since Release 1.0 | ======= Inheritance ======= //No parent, interface or trait. This is a root type.// ======= Constants (4) ======= ^ Visibility ^ Name ^ Value ^ Line ^ | ''-'' | ''DESTINATION_WORDPRESS'' | '''wordpress';'' | 36 | | ''-'' | ''DESTINATION_GHOST'' | '''ghost';'' | 37 | | ''-'' | ''DESTINATION_BLOGSPOT'' | '''blogspot';'' | 38 | | ''-'' | ''DESTINATION_SCRIPTLOG'' | '''scriptlog';'' | 39 | ======= Properties (4) ======= ^ Visibility ^ Type ^ Name ^ Default ^ Line ^ | ''private'' | ''(untyped)'' | ''$dbc'' | | 31 | | ''private'' | ''(untyped)'' | ''$userDao'' | | 32 | | ''private'' | ''(untyped)'' | ''$authorId'' | | 33 | | ''private'' | ''(untyped)'' | ''$exportStats'' | | 34 | ======= Methods (16) ======= ^ Visibility ^ Method ^ Summary ^ Line ^ | public | ''__construct()'' | ExportService constructor. | 46 | | public | ''setAuthorId()'' | Set author ID for filtering content (optional) | 65 | | public | ''getStats()'' | Get export statistics | 75 | | public | ''resetStats()'' | Reset export statistics | 85 | | public | ''getExportUsers()'' | Get users available as export authors for the export form. | 102 | | public | ''exportToWordPress()'' | Export content to WordPress WXR format | 114 | | public | ''exportToGhost()'' | Export content to Ghost JSON format | 143 | | public | ''exportToBlogspot()'' | Export content to Blogspot XML format | 172 | | public | ''exportToScriptlog()'' | Export content to Scriptlog native JSON format | 202 | | protected | ''getPosts()'' | Get posts for export | 232 | | protected | ''getPages()'' | Get pages for export | 275 | | protected | ''getCategories()'' | Get categories/topics for export | 319 | | protected | ''getPostCategories()'' | Get categories associated with a post | 336 | | protected | ''getPostTags()'' | Get tags from post_tags field (comma-separated) | 354 | | protected | ''getPostComments()'' | Get comments for a post | 373 | | protected | ''sanitizeInput()'' | Sanitize input for export | 391 | ======== __construct() ======== public function __construct(UserDao $userDao) //lines 46–58 (13)// ExportService constructor. ^ Parameter ^ Type ^ Default ^ Description ^ | ''$userDao'' | [[scriptlog:lib:dao:userdao|''UserDao'']] | //required// | Data access for export author lookups | ======== setAuthorId() ======== public function setAuthorId($authorId) //lines 65–68 (4)// Set author ID for filtering content (optional) ^ Parameter ^ Type ^ Default ^ Description ^ | ''$authorId'' | ''(untyped)'' | //required// | //none// | **Returns:** ''(none declared)'' ======== getStats() ======== public function getStats() //lines 75–78 (4)// Get export statistics //Takes no parameters.// **Returns:** ''(none declared)'' — array ======== resetStats() ======== public function resetStats() //lines 85–93 (9)// Reset export statistics //Takes no parameters.// **Returns:** ''(none declared)'' — void ======== getExportUsers() ======== public function getExportUsers(): array //lines 102–107 (6)// Get users available as export authors for the export form. Normalizes the DAO result to an array so callers never receive false. //Takes no parameters.// **Returns:** ''array'' — array List of user rows, empty when no users exist ======== exportToWordPress() ======== public function exportToWordPress() //lines 114–136 (23)// Export content to WordPress WXR format //Takes no parameters.// **Returns:** ''(none declared)'' — array ======== exportToGhost() ======== public function exportToGhost() //lines 143–165 (23)// Export content to Ghost JSON format //Takes no parameters.// **Returns:** ''(none declared)'' — array ======== exportToBlogspot() ======== public function exportToBlogspot() //lines 172–194 (23)// Export content to Blogspot XML format //Takes no parameters.// **Returns:** ''(none declared)'' — array ======== exportToScriptlog() ======== public function exportToScriptlog() //lines 202–224 (23)// Export content to Scriptlog native JSON format This format can be imported directly into another Scriptlog installation //Takes no parameters.// **Returns:** ''(none declared)'' — array ======== getPosts() ======== protected function getPosts($authorId = null) //lines 232–267 (36)// Get posts for export ^ Parameter ^ Type ^ Default ^ Description ^ | ''$authorId'' | ''(untyped)'' | ''null'' | //none// | **Returns:** ''(none declared)'' — array ======== getPages() ======== protected function getPages($authorId = null) //lines 275–312 (38)// Get pages for export ^ Parameter ^ Type ^ Default ^ Description ^ | ''$authorId'' | ''(untyped)'' | ''null'' | //none// | **Returns:** ''(none declared)'' — array ======== getCategories() ======== protected function getCategories() //lines 319–328 (10)// Get categories/topics for export //Takes no parameters.// **Returns:** ''(none declared)'' — array ======== getPostCategories() ======== protected function getPostCategories($postId) //lines 336–346 (11)// Get categories associated with a post ^ Parameter ^ Type ^ Default ^ Description ^ | ''$postId'' | ''(untyped)'' | //required// | //none// | **Returns:** ''(none declared)'' — array ======== getPostTags() ======== protected function getPostTags($tagsField) //lines 354–365 (12)// Get tags from post_tags field (comma-separated) ^ Parameter ^ Type ^ Default ^ Description ^ | ''$tagsField'' | ''(untyped)'' | //required// | //none// | **Returns:** ''(none declared)'' — array ======== getPostComments() ======== protected function getPostComments($postId) //lines 373–383 (11)// Get comments for a post ^ Parameter ^ Type ^ Default ^ Description ^ | ''$postId'' | ''(untyped)'' | //required// | //none// | **Returns:** ''(none declared)'' — array ======== sanitizeInput() ======== protected function sanitizeInput($input) //lines 391–398 (8)// Sanitize input for export ^ Parameter ^ Type ^ Default ^ Description ^ | ''$input'' | ''(untyped)'' | //required// | //none// | **Returns:** ''(none declared)'' — string ======= Imports ======= ^ Alias ^ Fully-qualified name ^ | ''ExportException'' | [[scriptlog:lib:core:exportexception|''Scriptlog\Core\ExportException'']] | | ''Registry'' | [[scriptlog:lib:core:registry|''Scriptlog\Core\Registry'']] | | ''Sanitize'' | [[scriptlog:lib:core:sanitize|''Scriptlog\Core\Sanitize'']] | | ''UserDao'' | [[scriptlog:lib:dao:userdao|''Scriptlog\Dao\UserDao'']] | | ''BlogspotExporter'' | [[scriptlog:lib:utility:blogspotexporter|''BlogspotExporter'']] | | ''GhostExporter'' | [[scriptlog:lib:utility:ghostexporter|''GhostExporter'']] | | ''ScriptlogExporter'' | [[scriptlog:lib:utility:scriptlogexporter|''ScriptlogExporter'']] | | ''WordPressExporter'' | [[scriptlog:lib:utility:wordpressexporter|''WordPressExporter'']] | ---- //This page is generated from source by 'tools/gendoc'. Edits will be overwritten.//