PHP Class Puli\Repository\Discovery\ResourceBinding

Since: 1.0
Author: Bernhard Schussek ([email protected])
Inheritance: extends Puli\Discovery\Binding\AbstractBinding
Show file Open project: puli/repository Class Usage Examples

Public Methods

Method Description
__construct ( string $query, string $typeName, array $parameterValues = [], string $language = 'glob' ) Creates a new resource binding.
equals ( Puli\Discovery\Api\Binding\Binding $other )
getLanguage ( ) : string Returns the language of the query.
getQuery ( ) : string Returns the query for the resources of the binding.
getResources ( ) : Puli\Repository\Api\ResourceCollection Returns the bound resources.
setRepository ( Puli\Repository\Api\ResourceRepository $repo ) Sets the repository used to load resources.

Protected Methods

Method Description
postUnserialize ( array &$data )
preSerialize ( array &$data )

Method Details

__construct() public method

A resource binding has a query that is used to retrieve the resources matched by the binding. You can pass parameters that have been defined for the type. If you pass unknown parameters, or if a required parameter is missing, an exception is thrown. All parameters that you do not set here will receive the default values set for the parameter.
public __construct ( string $query, string $typeName, array $parameterValues = [], string $language = 'glob' )
$query string The resource query.
$typeName string The type to bind against.
$parameterValues array The values of the parameters defined for the type.
$language string The language of the resource query.

equals() public method

public equals ( Puli\Discovery\Api\Binding\Binding $other )
$other Puli\Discovery\Api\Binding\Binding

getLanguage() public method

Returns the language of the query.
public getLanguage ( ) : string
return string The query language.

getQuery() public method

Returns the query for the resources of the binding.
public getQuery ( ) : string
return string The resource query.

getResources() public method

Returns the bound resources.
public getResources ( ) : Puli\Repository\Api\ResourceCollection
return Puli\Repository\Api\ResourceCollection The bound resources.

postUnserialize() protected method

protected postUnserialize ( array &$data )
$data array

preSerialize() protected method

protected preSerialize ( array &$data )
$data array

setRepository() public method

Sets the repository used to load resources.
public setRepository ( Puli\Repository\Api\ResourceRepository $repo )
$repo Puli\Repository\Api\ResourceRepository The resource repository.