PHP Class WDS_WP_REST_API\Discover\Site

Show file Open project: webdevstudios/wds-wp-rest-api-connect

Protected Properties

Property Type Description
$data stdClass Data from the API index.
$index string API index URL.

Public Methods

Method Description
__construct ( stdClass $data, string $index ) Constructor.
getAuthenticationData ( string $method ) : mixed Get method-specific data for the given authentication method.
getDescription ( ) : string Get the description for a site.
getIndexURL ( ) : string Get the index URL for the API.
getName ( ) : string Get the name of a site.
getSupportedAuthentication ( ) : array Get features supported by the site.
getSupportedNamespaces ( ) : string[] Get namespaces supported by the site.
getURL ( ) : string Get the URL for a site.
supportsAuthentication ( string $method ) : boolean Does the site support an authentication method?
supportsNamespace ( string $namespace ) : boolean Does the site support a namespace?

Method Details

__construct() public method

Constructor.
public __construct ( stdClass $data, string $index )
$data stdClass Data from the API index.
$index string API index URL.

getAuthenticationData() public method

Get method-specific data for the given authentication method.
public getAuthenticationData ( string $method ) : mixed
$method string Authentication method to get data for.
return mixed Method-specific data if available, null if not supported.

getDescription() public method

Get the description for a site.
public getDescription ( ) : string
return string

getIndexURL() public method

Get the index URL for the API.
public getIndexURL ( ) : string
return string

getName() public method

Get the name of a site.
public getName ( ) : string
return string

getSupportedAuthentication() public method

Get features supported by the site.
public getSupportedAuthentication ( ) : array
return array Map of authentication method => method-specific data.

getSupportedNamespaces() public method

Get namespaces supported by the site.
public getSupportedNamespaces ( ) : string[]
return string[] List of namespaces supported by the site.

getURL() public method

Get the URL for a site.
public getURL ( ) : string
return string

supportsAuthentication() public method

Does the site support an authentication method?
public supportsAuthentication ( string $method ) : boolean
$method string Authentication method to check.
return boolean True if supported by the site, false otherwise.

supportsNamespace() public method

Does the site support a namespace?
public supportsNamespace ( string $namespace ) : boolean
$namespace string Namespace to check.
return boolean True if supported by the site, false otherwise.

Property Details

$data protected property

Data from the API index.
protected stdClass $data
return stdClass

$index protected property

API index URL.
protected string $index
return string