PHP Класс Apple_Exporter\Exporter

NOTE: This class is designed to work outside of WordPress just fine, so it can be a dependency. It can be used to create other plugins, for example, a Joomla or Drupal plugin. Even though this is not a WordPress class it follows its coding conventions.
С версии: 0.2.0
Автор: Federico Ramirez
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( apple_exporter\Exporter_Content $content, Workspace $workspace = null, Settings $settings = null ) Constructor.
export ( ) : string Based on the content this instance holds, create an Article Format bundle.
generate ( ) Generates JSON for the article.json file. By doing this, all attachments get added to the workspace/tmp directory automatically.
get_bundles ( ) : array Get the bundles from the workspace.
get_content ( ) : apple_exporter\Exporter_Content Get the Exporter_Content object
get_errors ( ) : array Get the errors from the workspace.
get_json ( ) : string Get the JSON output from the workspace.
initialize_builders ( array $builders = null ) An ordered hash of builders. They will be executed in order when building the JSON array.
workspace ( ) : Workspace Gets the instance of the current workspace.

Приватные методы

Метод Описание
build_article_style ( ) : array Build the article style.
clean_workspace ( ) Clean up the current workspace.
content_id ( ) : integer Get the content ID.
content_title ( ) : string Get the content title.
generate_json ( ) : string Generate article.json contents. It does so by looping though all data, generating valid JSON and adding attachments to workspace/tmp directory.
get_builder ( string $name ) : Builder Get a builder.
register_builder ( string $name, Builder $builder ) Register a builder.
write_json ( $content ) Write the JSON output to the Workspace.

Описание методов

__construct() публичный Метод

Constructor.
public __construct ( apple_exporter\Exporter_Content $content, Workspace $workspace = null, Settings $settings = null )
$content apple_exporter\Exporter_Content
$workspace Workspace
$settings Settings

export() публичный Метод

and return the path. This function builds the article and cleans up after.
public export ( ) : string
Результат string

generate() публичный Метод

When called, clean_workspace must always be called before and afterwards.
С версии: 0.4.0
public generate ( )

get_bundles() публичный Метод

Get the bundles from the workspace.
public get_bundles ( ) : array
Результат array

get_content() публичный Метод

Get the Exporter_Content object
public get_content ( ) : apple_exporter\Exporter_Content
Результат apple_exporter\Exporter_Content

get_errors() публичный Метод

Get the errors from the workspace.
public get_errors ( ) : array
Результат array

get_json() публичный Метод

Get the JSON output from the workspace.
public get_json ( ) : string
Результат string

initialize_builders() публичный Метод

An ordered hash of builders. They will be executed in order when building the JSON array.
С версии: 0.4.0
public initialize_builders ( array $builders = null )
$builders array

workspace() публичный Метод

Gets the instance of the current workspace.
С версии: 0.4.0
public workspace ( ) : Workspace
Результат Workspace