PHP Интерфейс Yosymfony\Spress\Core\DataSource\ItemInterface

Автор: Victor Puertas ([email protected])
Показать файл Открыть проект Примеры использования интерфейса

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

Метод Описание
getAttributes ( ) : array The item’s attributes.
getCollection ( ) : string Gets the collection of the item. e.g: "pages" or "posts".
getContent ( $snapshotName = '' ) : string Get the compiled content. A snapshot is the compiled content at a specific point during the compilation process. "last" snapshot is the most recent compiled content. Binary content cannot have snapshots.
getId ( ) : string A string that uniquely identifies an item.
getPath ( $snapshotName = '' ) : string The item's relative path. e.g: "index.html" or "my-page/index.html".
getRelationshipCollection ( ) : Yosymfony\Spress\Core\DataSource\RelationshipCollection Gets the RelationshipCollection instance associated with this item.
getType ( ) : string Return the type of this item. Values: "item", "layout" or "include".
isBinary ( ) : boolean True if the item is binary; false if it is not.
setAttributes ( array $values ) Set the attributes of this item.
setCollection ( string $name ) Sets the collection of the item.
setContent ( $content, $snapshotName ) Set the compiled content.
setPath ( string $value, $snapshotName ) Set the item's relative path.

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

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

The item’s attributes.
public getAttributes ( ) : array
Результат array

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

"pages" is the defatul collection.
public getCollection ( ) : string
Результат string The name of the collection

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

Snaptshots: - raw: the uncompiled content of this item (not available for binary items). - last: the most recent compiled content. - after_convert: the compiled content after converter has been applied. - after_render: the compiled content after renderizer has been applied.
public getContent ( $snapshotName = '' ) : string
$snapshotName The name of the snapshot. "last" by default
Результат string The content or empty-string If the snapshot does not exist

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

A string that uniquely identifies an item.
public getId ( ) : string
Результат string

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

An Item without path will not be stored. Snaptshots: - last: the most recent path. - relative: relative path. - absolute: absolute path. Useful for binary content. - permalink: a relative path generated by permalink generator component.
public getPath ( $snapshotName = '' ) : string
$snapshotName The name of the snapshot. "last" by default
Результат string The path or empty-string If the snapshot does not exist

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

Gets the RelationshipCollection instance associated with this item.
public getRelationshipCollection ( ) : Yosymfony\Spress\Core\DataSource\RelationshipCollection
Результат Yosymfony\Spress\Core\DataSource\RelationshipCollection A RelationshipCollection instance

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

Return the type of this item. Values: "item", "layout" or "include".
public getType ( ) : string
Результат string

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

True if the item is binary; false if it is not.
public isBinary ( ) : boolean
Результат boolean

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

Set the attributes of this item.
public setAttributes ( array $values )
$values array

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

Sets the collection of the item.
public setCollection ( string $name )
$name string The name of the collection

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

Set the compiled content.
public setContent ( $content, $snapshotName )
$content Mixed The compiled content
$snapshotName The name of the snapshot. The snapshot "last" is not valid

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

Set the item's relative path.
public setPath ( string $value, $snapshotName )
$value string e.g: "index.html" or "my-page/index.html"
$snapshotName The name of the snapshot. The snapshot "last" is not valid