PHP Class eZ\Publish\Core\FieldType\Page\PageService

Show file Open project: ezsystems/ezpublish-kernel Class Usage Examples

Protected Properties

Property Type Description
$archivedBlockItems SplObjectStorage Cached archived block items by block.
$blockDefinition array Block definition set in YAML config.
$blocksById eZ\Publish\Core\FieldType\Page\Parts\Block[] Cached Blocks by id.
$contentService eZ\Publish\API\Repository\ContentService
$lastValidItems SplObjectStorage Cached last valid items, by block (one per block).
$storageGateway eZ\Publish\Core\FieldType\Page\PageStorage\Gateway
$validBlockItems SplObjectStorage Cached valid block items by block.
$waitingBlockItems SplObjectStorage Cached waiting block items by block.
$zoneDefinition array Zone definition set in YAML config.

Public Methods

Method Description
__construct ( eZ\Publish\API\Repository\ContentService $contentService, array $zoneDefinition = [], array $blockDefinition = [] ) Constructor.
getArchivedBlockItems ( Block $block ) : Item[] Returns archived items (that were previously displayed), for a given block.
getAvailableZoneLayouts ( ) : array Returns list of available zone layouts.
getBlockDefinition ( ) : array Returns block definition as an array.
getBlockDefinitionByIdentifier ( string $blockIdentifier ) : array Returns a block definition for a given block identifier.
getLastValidBlockItem ( Block $block ) : Item | null Returns the last valid item, for a given block.
getLayoutTemplate ( string $layoutIdentifier ) : string Returns the template to use for given layout.
getValidBlockItems ( Block $block ) : Item[] Returns valid items (that are to be displayed), for a given block.
getWaitingBlockItems ( Block $block ) : Item[] Returns queued items (the next to be displayed), for a given block.
getZoneDefinition ( ) : array Returns zone definition as an array.
getZoneDefinitionByLayout ( string $layoutIdentifier ) : array Returns a zone definition for a given layout.
hasBlockDefinition ( string $blockIdentifier ) : boolean Checks if block definition contains a block having $blockIdentifier as identifier.
hasStorageGateway ( ) : boolean Checks if storage gateway has already been injected or not.
hasZoneLayout ( string $layoutIdentifier ) : boolean Checks if zone definition contains a layout having $layoutIdentifier as identifier.
loadBlock ( integer | string $id ) : Block Loads Block object for the given $id.
setStorageGateway ( Gateway $storageGateway ) Injects the storage gateway to interact with.

Protected Methods

Method Description
getStorageGateway ( ) : Gateway

Method Details

__construct() public method

Constructor.
public __construct ( eZ\Publish\API\Repository\ContentService $contentService, array $zoneDefinition = [], array $blockDefinition = [] )
$contentService eZ\Publish\API\Repository\ContentService
$zoneDefinition array
$blockDefinition array

getArchivedBlockItems() public method

Returns archived items (that were previously displayed), for a given block.
public getArchivedBlockItems ( Block $block ) : Item[]
$block eZ\Publish\Core\FieldType\Page\Parts\Block
return eZ\Publish\Core\FieldType\Page\Parts\Item[]

getAvailableZoneLayouts() public method

Returns list of available zone layouts.
public getAvailableZoneLayouts ( ) : array
return array

getBlockDefinition() public method

Returns block definition as an array.
public getBlockDefinition ( ) : array
return array

getBlockDefinitionByIdentifier() public method

Returns a block definition for a given block identifier.
public getBlockDefinitionByIdentifier ( string $blockIdentifier ) : array
$blockIdentifier string
return array

getLastValidBlockItem() public method

Returns the last valid item, for a given block.
public getLastValidBlockItem ( Block $block ) : Item | null
$block eZ\Publish\Core\FieldType\Page\Parts\Block
return eZ\Publish\Core\FieldType\Page\Parts\Item | null

getLayoutTemplate() public method

Returns the template to use for given layout.
public getLayoutTemplate ( string $layoutIdentifier ) : string
$layoutIdentifier string
return string

getStorageGateway() protected method

protected getStorageGateway ( ) : Gateway
return eZ\Publish\Core\FieldType\Page\PageStorage\Gateway

getValidBlockItems() public method

Returns valid items (that are to be displayed), for a given block.
public getValidBlockItems ( Block $block ) : Item[]
$block eZ\Publish\Core\FieldType\Page\Parts\Block
return eZ\Publish\Core\FieldType\Page\Parts\Item[]

getWaitingBlockItems() public method

Returns queued items (the next to be displayed), for a given block.
public getWaitingBlockItems ( Block $block ) : Item[]
$block eZ\Publish\Core\FieldType\Page\Parts\Block
return eZ\Publish\Core\FieldType\Page\Parts\Item[]

getZoneDefinition() public method

Returns zone definition as an array.
public getZoneDefinition ( ) : array
return array

getZoneDefinitionByLayout() public method

It consists of a configuration array for the given layout.
public getZoneDefinitionByLayout ( string $layoutIdentifier ) : array
$layoutIdentifier string
return array

hasBlockDefinition() public method

Checks if block definition contains a block having $blockIdentifier as identifier.
public hasBlockDefinition ( string $blockIdentifier ) : boolean
$blockIdentifier string
return boolean

hasStorageGateway() public method

Checks if storage gateway has already been injected or not.
public hasStorageGateway ( ) : boolean
return boolean

hasZoneLayout() public method

Checks if zone definition contains a layout having $layoutIdentifier as identifier.
public hasZoneLayout ( string $layoutIdentifier ) : boolean
$layoutIdentifier string
return boolean

loadBlock() public method

Loads Block object for the given $id.
public loadBlock ( integer | string $id ) : Block
$id integer | string
return eZ\Publish\Core\FieldType\Page\Parts\Block

setStorageGateway() public method

Injects the storage gateway to interact with.
public setStorageGateway ( Gateway $storageGateway )
$storageGateway eZ\Publish\Core\FieldType\Page\PageStorage\Gateway

Property Details

$archivedBlockItems protected property

Cached archived block items by block.
protected SplObjectStorage $archivedBlockItems
return SplObjectStorage

$blockDefinition protected property

Block definition set in YAML config.
protected array $blockDefinition
return array

$blocksById protected property

Cached Blocks by id.
protected Block[],eZ\Publish\Core\FieldType\Page\Parts $blocksById
return eZ\Publish\Core\FieldType\Page\Parts\Block[]

$contentService protected property

protected ContentService,eZ\Publish\API\Repository $contentService
return eZ\Publish\API\Repository\ContentService

$lastValidItems protected property

Cached last valid items, by block (one per block).
protected SplObjectStorage $lastValidItems
return SplObjectStorage

$storageGateway protected property

protected Gateway,eZ\Publish\Core\FieldType\Page\PageStorage $storageGateway
return eZ\Publish\Core\FieldType\Page\PageStorage\Gateway

$validBlockItems protected property

Cached valid block items by block.
protected SplObjectStorage $validBlockItems
return SplObjectStorage

$waitingBlockItems protected property

Cached waiting block items by block.
protected SplObjectStorage $waitingBlockItems
return SplObjectStorage

$zoneDefinition protected property

Zone definition set in YAML config.
protected array $zoneDefinition
return array