PHP Интерфейс 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) { ... }
С версии: 1.0
Автор: Bernhard Schussek ([email protected])
Автор: Titouan Galopin ([email protected])
Показать файл Открыть проект Примеры использования интерфейса

Открытые методы

Метод Описание
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.

Описание методов

contains() публичный Метод

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".
Результат boolean Returns `true` if any resources exist that match the query.

find() публичный Метод

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".
Результат Puli\Repository\Api\ResourceCollection The resources matching the query.

get() публичный Метод

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.
Результат Puli\Repository\Api\Resource\PuliResource The resource at this path.

getVersions() публичный Метод

Returns all versions of a resource.
public getVersions ( string $path ) : VersionList
$path string The path to the resource.
Результат Puli\Repository\Api\ChangeStream\VersionList The versions stored for this path.

hasChildren() публичный Метод

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.
Результат boolean Returns `true` if the resource has child resources.

listChildren() публичный Метод

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.
Результат Puli\Repository\Api\ResourceCollection The child resources of the resource.