PHP Class Mlp_Language_Api

Not complete yet.
Author: Inpsyde GmbH, toscho
Inheritance: implements Mlp_Language_Api_Interface
Mostrar archivo Open project: inpsyde/multilingual-press

Public Methods

Method Description
__construct ( Inpsyde_Property_List_Interface $data, string $table_name, Inpsyde\MultilingualPress\API\SiteRelations $site_relations, Inpsyde\MultilingualPress\API\ContentRelations $content_relations, wpdb $wpdb, Inpsyde\MultilingualPress\Factory\TypeFactory $type_factory, Inpsyde\MultilingualPress\Common\Request $request ) Constructor.
get_translations ( array $args = [] ) : Inpsyde\MultilingualPress\Common\Type\Translation[] Ask for specific translations with arguments.

Private Methods

Method Description
get_all_language_data ( ) : array
get_post_translation ( integer $content_id, boolean $strict ) : array | boolean Get translation for posts of any post type.
get_post_type_archive_translation ( string $post_type ) : array Get translation for post type archive
prepare_translation_arguments ( array $args ) : array

Method Details

__construct() public method

Constructor.
public __construct ( Inpsyde_Property_List_Interface $data, string $table_name, Inpsyde\MultilingualPress\API\SiteRelations $site_relations, Inpsyde\MultilingualPress\API\ContentRelations $content_relations, wpdb $wpdb, Inpsyde\MultilingualPress\Factory\TypeFactory $type_factory, Inpsyde\MultilingualPress\Common\Request $request )
$data Inpsyde_Property_List_Interface
$table_name string
$site_relations Inpsyde\MultilingualPress\API\SiteRelations
$content_relations Inpsyde\MultilingualPress\API\ContentRelations
$wpdb wpdb
$type_factory Inpsyde\MultilingualPress\Factory\TypeFactory Type factory object.
$request Inpsyde\MultilingualPress\Common\Request Request object.

get_translations() public method

Ask for specific translations with arguments.
See also: prepare_translation_arguments()
public get_translations ( array $args = [] ) : Inpsyde\MultilingualPress\Common\Type\Translation[]
$args array { Optional. If left out, some magic happens. @type int $site_id Base site @type int $content_id post or term_taxonomy ID, *not* term ID @type string $type @see Mlp_Language_Api::get_request_type() @type bool $strict When TRUE (default) only matching exact translations will be included @type string $search_term If you want to translate a search @type string $post_type For post type archives @type bool $include_base Include the base site in returned list }
return Inpsyde\MultilingualPress\Common\Type\Translation[] Array of Mlp_Translation instances, site IDs are the keys