PHP Interface Puli\Repository\Api\ResourceRepository

A resource repository is similar to a filesystem. It stores {@link PuliResource} objects, each of which has a path in the repository: php $resource = $repo->get('/css/style.css'); Resources may have child resources. These can be accessed with {@link listChildren()}: php $resource = $repo->get('/css'); foreach ($resource->listChildren() as $name => $resource) { ... }
Since: 1.0
Author: Bernhard Schussek ([email protected])
Author: Titouan Galopin ([email protected])
Afficher le fichier Open project: puli/repository Interface Usage Examples

Méthodes publiques

Méthode Description
contains ( string $query, string $language = 'glob' ) : boolean Returns whether any resources match a query.
find ( string $query, string $language = 'glob' ) : Puli\Repository\Api\ResourceCollection Returns the resources matching a query.
get ( string $path ) : Puli\Repository\Api\Resource\PuliResource Returns the resource at the given path.
getVersions ( string $path ) : VersionList Returns all versions of a resource.
hasChildren ( string $path ) : boolean Returns whether a resource has child resources.
listChildren ( string $path ) : Puli\Repository\Api\ResourceCollection Lists the child resources of a resource.

Method Details

contains() public méthode

Returns whether any resources match a query.
public contains ( string $query, string $language = 'glob' ) : boolean
$query string A resource query.
$language string The language of the query. All implementations must support the language "glob".
Résultat boolean Returns `true` if any resources exist that match the query.

find() public méthode

Returns the resources matching a query.
public find ( string $query, string $language = 'glob' ) : Puli\Repository\Api\ResourceCollection
$query string A resource query.
$language string The language of the query. All implementations must support the language "glob".
Résultat Puli\Repository\Api\ResourceCollection The resources matching the query.

get() public méthode

Returns the resource at the given path.
public get ( string $path ) : Puli\Repository\Api\Resource\PuliResource
$path string The path to the resource. Must start with "/". "." and ".." segments in the path are supported.
Résultat Puli\Repository\Api\Resource\PuliResource The resource at this path.

getVersions() public méthode

Returns all versions of a resource.
public getVersions ( string $path ) : VersionList
$path string The path to the resource.
Résultat Puli\Repository\Api\ChangeStream\VersionList The versions stored for this path.

hasChildren() public méthode

Returns whether a resource has child resources.
public hasChildren ( string $path ) : boolean
$path string The path to the resource. Must start with "/". "." and ".." segments in the path are supported.
Résultat boolean Returns `true` if the resource has child resources.

listChildren() public méthode

Lists the child resources of a resource.
public listChildren ( string $path ) : Puli\Repository\Api\ResourceCollection
$path string The path to the resource. Must start with "/". "." and ".." segments in the path are supported.
Résultat Puli\Repository\Api\ResourceCollection The child resources of the resource.