PHP Class FOF30\Hal\Link

See also: http://stateless.co/hal_specification.html
Show file Open project: akeeba/fof Class Usage Examples

Protected Properties

Property Type Description
$_href string For indicating the target URI. Corresponds with the ’Target IRI’ as defined in Web Linking (RFC 5988). This attribute MAY contain a URI Template (RFC6570) and in which case, SHOULD be complemented by an additional templated attribute on the link with a boolean value true.
$_hreflang string For indicating what the language of the result of dereferencing the link should be.
$_name string For distinguishing between Resource and Link elements that share the same relation
$_templated boolean This attribute SHOULD be present with a boolean value of true when the href of the link contains a URI Template (RFC6570).
$_title string For labeling the destination of a link with a human-readable identifier.

Public Methods

Method Description
__construct ( string $href, boolean $templated = false, string $name = null, string $hreflang = null, string $title = null ) Public constructor of a FOFHalLink object
__get ( string $name ) : mixed Magic getter for the protected properties
__set ( string $name, mixed $value ) : void Magic setter for the protected properties
check ( ) : boolean Is this a valid link? Checks the existence of required fields, not their values.

Method Details

__construct() public method

Public constructor of a FOFHalLink object
public __construct ( string $href, boolean $templated = false, string $name = null, string $hreflang = null, string $title = null )
$href string See $this->_href
$templated boolean See $this->_templated
$name string See $this->_name
$hreflang string See $this->_hreflang
$title string See $this->_title

__get() public method

Magic getter for the protected properties
public __get ( string $name ) : mixed
$name string The name of the property to retrieve, sans the underscore
return mixed Null will always be returned if the property doesn't exist

__set() public method

Magic setter for the protected properties
public __set ( string $name, mixed $value ) : void
$name string The name of the property to set, sans the underscore
$value mixed The value of the property to set
return void

check() public method

Is this a valid link? Checks the existence of required fields, not their values.
public check ( ) : boolean
return boolean

Property Details

$_href protected property

For indicating the target URI. Corresponds with the ’Target IRI’ as defined in Web Linking (RFC 5988). This attribute MAY contain a URI Template (RFC6570) and in which case, SHOULD be complemented by an additional templated attribute on the link with a boolean value true.
protected string $_href
return string

$_hreflang protected property

For indicating what the language of the result of dereferencing the link should be.
protected string $_hreflang
return string

$_name protected property

For distinguishing between Resource and Link elements that share the same relation
protected string $_name
return string

$_templated protected property

This attribute SHOULD be present with a boolean value of true when the href of the link contains a URI Template (RFC6570).
protected bool $_templated
return boolean

$_title protected property

For labeling the destination of a link with a human-readable identifier.
protected string $_title
return string