PHP Class Apple_Actions\Index\Section

Inheritance: extends Apple_Actions\API_Action
Datei anzeigen Open project: alleyinteractive/apple-news

Public Methods

Method Description
__construct ( Settings $settings, string $section_id = null ) Constructor.
get_data ( string $key, string $default = null ) : mixed Get a specific element of section data from Apple News
get_sections ( ) : array Get all available sections.
perform ( ) : object Get the section data from Apple News.

Method Details

__construct() public method

Constructor.
public __construct ( Settings $settings, string $section_id = null )
$settings Settings
$section_id string

get_data() public method

Get a specific element of section data from Apple News
public get_data ( string $key, string $default = null ) : mixed
$key string
$default string
return mixed

get_sections() public method

Cache for 5 minutes to avoid too many API requests.
public get_sections ( ) : array
return array

perform() public method

Get the section data from Apple News.
public perform ( ) : object
return object