PHP Class Newscoop\Service\Resource\ResourceId

Datei anzeigen Open project: sourcefabric/newscoop Class Usage Examples

Protected Properties

Property Type Description
$id string
$parent Newscoop\Service\Resource\ResourceId
$type string

Public Methods

Method Description
__construct ( string $id, $type = ResourceId::TYPE_ROOT ) Construct a resource id for the provided id.
getFullId ( ) : string Provides the full id of the resource, this id will be full path of the requesting layer components separated by ':'.
getId ( ) : string Provides the id of the resource, attention this is not the full id is just this resource id.
getProperties ( ) : array Provides the properties for the current resource id.
getService ( string $serviceName ) : mixed Provides the service for the requested service name.
getType ( ) : string Provides the type of the resource, please check the contstants on this class to see what are the posible types.

Method Details

__construct() public method

The id should not be provided as a plain string it should be the actuall simple class name of the top class (Controller) that creates the resource.
public __construct ( string $id, $type = ResourceId::TYPE_ROOT )
$id string The id of the theme, must not be null or empty.

getFullId() public method

Provides the full id of the resource, this id will be full path of the requesting layer components separated by ':'.
public getFullId ( ) : string
return string The full id of the resource.

getId() public method

Provides the id of the resource, attention this is not the full id is just this resource id.
public getId ( ) : string
return string The id of the resource.

getProperties() public method

Provides the properties for the current resource id.
public getProperties ( ) : array
return array The array containing all the properties, not null can be empty.

getService() public method

The id should not be provided as a plain string it should be the actuall class name ot the service API beeing requested. As a convention this id should be obtain from the NAME contstant of a interface (ex: IThemeService::NAME), where NAME is defined in the interface as 'const NAME = __CLASS__', if apllicable.
public getService ( string $serviceName ) : mixed
$serviceName string The class name of the interface beeing requested, must not be null or empty.
return mixed The resource id obtained for this service request.

getType() public method

Provides the type of the resource, please check the contstants on this class to see what are the posible types.
public getType ( ) : string
return string The type of the resource.

Property Details

$id protected_oe property

protected string $id
return string

$parent protected_oe property

protected Newscoop\Service\Resource\ResourceId $parent
return Newscoop\Service\Resource\ResourceId

$type protected_oe property

protected string $type
return string