PHP Class Hal\Link

Inheritance: extends AbstractHal
Show file Open project: zircote/hal Class Usage Examples

Protected Properties

Property Type Description
$_href string Applications which use HAL MAY clarify the integrity of specific embedded content via the description of the relevant @rel value. - As a link: This attribute MAY contain a URI template. Whether or not this is the case SHOULD be indicated to clients by the @rel value.
$_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 @rel value. The @name attribute SHOULD NOT be used exclusively for identifying elements within a HAL representation, it is intended only as a 'secondary key' to a given @rel value.
$_rel string The Subject Resource is the closest parent Resource element.
$_templated boolean Whether this link is "templated"
$_title string For labeling the destination of a link with a human-readable identifier.

Public Methods

Method Description
__construct ( string $href, string $rel = 'self', string $title = null, string $name = null, string $hreflang = null, boolean $templated = false )
getHref ( ) : string
getHreflang ( ) : string
getName ( ) : string
getRel ( ) : string
getTemplated ( ) : boolean
getTitle ( ) : string
setHref ( string $href ) : Link
setHreflang ( string $hreflang ) : Link
setName ( string $name ) : Link
setRel ( string $rel ) : Link
setTemplated ( boolean $templated ) : Link
setTitle ( string $title ) : Link
toArray ( ) : array

Method Details

__construct() public method

public __construct ( string $href, string $rel = 'self', string $title = null, string $name = null, string $hreflang = null, boolean $templated = false )
$href string
$rel string
$title string
$name string
$hreflang string
$templated boolean

getHref() public method

public getHref ( ) : string
return string

getHreflang() public method

public getHreflang ( ) : string
return string

getName() public method

public getName ( ) : string
return string

getRel() public method

public getRel ( ) : string
return string

getTemplated() public method

public getTemplated ( ) : boolean
return boolean

getTitle() public method

public getTitle ( ) : string
return string

setHref() public method

public setHref ( string $href ) : Link
$href string
return Link

setHreflang() public method

public setHreflang ( string $hreflang ) : Link
$hreflang string
return Link

setName() public method

public setName ( string $name ) : Link
$name string
return Link

setRel() public method

public setRel ( string $rel ) : Link
$rel string
return Link

setTemplated() public method

public setTemplated ( boolean $templated ) : Link
$templated boolean
return Link

setTitle() public method

public setTitle ( string $title ) : Link
$title string
return Link

toArray() public method

public toArray ( ) : array
return array

Property Details

$_href protected property

Applications which use HAL MAY clarify the integrity of specific embedded content via the description of the relevant @rel value. - As a link: This attribute MAY contain a URI template. Whether or not this is the case SHOULD be indicated to clients by the @rel value.
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 @rel value. The @name attribute SHOULD NOT be used exclusively for identifying elements within a HAL representation, it is intended only as a 'secondary key' to a given @rel value.
protected string $_name
return string

$_rel protected property

The Subject Resource is the closest parent Resource element.
protected string $_rel
return string

$_templated protected property

Whether this link is "templated"
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