Class

eZ\Publish\Core\FieldType\Page\PageService

class PageService

Methods

__construct(ContentService $contentService, array $zoneDefinition = array(), array $blockDefinition = array())

Constructor.

array getZoneDefinition()

Returns zone definition as an array.

array getZoneDefinitionByLayout(string $layoutIdentifier)

Returns a zone definition for a given layout.

string getLayoutTemplate(string $layoutIdentifier)

Returns the template to use for given layout.

bool hasZoneLayout(string $layoutIdentifier)

Checks if zone definition contains a layout having $layoutIdentifier as identifier.

array getAvailableZoneLayouts()

Returns list of available zone layouts.

array getBlockDefinition()

Returns block definition as an array.

array getBlockDefinitionByIdentifier(string $blockIdentifier)

Returns a block definition for a given block identifier.

bool hasBlockDefinition(string $blockIdentifier)

Checks if block definition contains a block having $blockIdentifier as identifier.

setStorageGateway(Gateway $storageGateway)

Injects the storage gateway to interact with.

bool hasStorageGateway()

Checks if storage gateway has already been injected or not.

Item[] getValidBlockItems(Block $block)

Returns valid items (that are to be displayed), for a given block.

Item|null getLastValidBlockItem(Block $block)

Returns the last valid item, for a given block.

Item[] getWaitingBlockItems(Block $block)

Returns queued items (the next to be displayed), for a given block.

Item[] getArchivedBlockItems(Block $block)

Returns archived items (that were previously displayed), for a given block.

Block loadBlock(int|string $id)

Loads Block object for the given $id.

Details

at line 88
public __construct(ContentService $contentService, array $zoneDefinition = array(), array $blockDefinition = array())

Constructor.

Parameters

ContentService $contentService
array $zoneDefinition
array $blockDefinition

at line 108
public array getZoneDefinition()

Returns zone definition as an array.

Return Value

array

at line 123
public array getZoneDefinitionByLayout(string $layoutIdentifier)

Returns a zone definition for a given layout.

It consists of a configuration array for the given layout.

Parameters

string $layoutIdentifier

Return Value

array

Exceptions

OutOfBoundsException If $layoutIdentifier is invalid

at line 139
public string getLayoutTemplate(string $layoutIdentifier)

Returns the template to use for given layout.

Parameters

string $layoutIdentifier

Return Value

string

at line 153
public bool hasZoneLayout(string $layoutIdentifier)

Checks if zone definition contains a layout having $layoutIdentifier as identifier.

Parameters

string $layoutIdentifier

Return Value

bool

at line 163
public array getAvailableZoneLayouts()

Returns list of available zone layouts.

Return Value

array

at line 173
public array getBlockDefinition()

Returns block definition as an array.

Return Value

array

at line 187
public array getBlockDefinitionByIdentifier(string $blockIdentifier)

Returns a block definition for a given block identifier.

Parameters

string $blockIdentifier

Return Value

array

Exceptions

OutOfBoundsException If $blockIdentifier is invalid.

at line 203
public bool hasBlockDefinition(string $blockIdentifier)

Checks if block definition contains a block having $blockIdentifier as identifier.

Parameters

string $blockIdentifier

Return Value

bool

at line 213
public setStorageGateway(Gateway $storageGateway)

Injects the storage gateway to interact with.

Parameters

Gateway $storageGateway

at line 223
public bool hasStorageGateway()

Checks if storage gateway has already been injected or not.

Return Value

bool

at line 249
public Item[] getValidBlockItems(Block $block)

Returns valid items (that are to be displayed), for a given block.

Parameters

Block $block

Return Value

Item[]

at line 265
public Item|null getLastValidBlockItem(Block $block)

Returns the last valid item, for a given block.

Parameters

Block $block

Return Value

Item|null

at line 281
public Item[] getWaitingBlockItems(Block $block)

Returns queued items (the next to be displayed), for a given block.

Parameters

Block $block

Return Value

Item[]

at line 297
public Item[] getArchivedBlockItems(Block $block)

Returns archived items (that were previously displayed), for a given block.

Parameters

Block $block

Return Value

Item[]

at line 315
public Block loadBlock(int|string $id)

Loads Block object for the given $id.

Parameters

int|string $id

Return Value

Block

Exceptions

NotFoundException If block could not be found.