Craft Themes (4.x)

DisplayService extends Service
in package

Table of Contents

CONFIG_KEY  = 'themes.displays'
EVENT_AFTER_DELETE  = 'after_delete'
EVENT_AFTER_SAVE  = 'after_save'
EVENT_BEFORE_APPLY_DELETE  = 'before_apply_delete'
EVENT_BEFORE_DELETE  = 'before_delete'
EVENT_BEFORE_SAVE  = 'before_save'
TYPE_FIELD  = 'field'
TYPE_GROUP  = 'group'
TYPES  = [self::TYPE_FIELD, self::TYPE_GROUP]
$_displays  : Collection
cleanUp()  : mixed
Clean up for view mode, deletes old displays
create()  : DisplayInterface
Create a display from config
createViewModeDisplays()  : array<string|int, DisplayInterface>
Create all displays for a view mode, will rebuild the existing ones
delete()  : bool
Deletes a display
getAll()  : Collection
Get all displays
getById()  : DisplayInterface|null
Get a display by id
getByUid()  : DisplayInterface|null
Get a display by uid
getForFieldType()  : DisplayInterface|null
Get all displays for a view mode and a field type
getForGroup()  : array<string|int, DisplayInterface>
Get all displays for a group
getForLayout()  : array<string|int, DisplayInterface>
Get all displays for a layout
getForViewMode()  : array<string|int, DisplayInterface>
Get all displays for a view mode
getRecordByUid()  : DisplayRecord
Get field record by uid or a new one if not found
handleChanged()  : mixed
Handles a change in display config
handleDeleted()  : mixed
Handles a deletion in display config
populateFromData()  : DisplayInterface
Populate a display from an array of data
rebuildConfig()  : mixed
Respond to rebuild config event
save()  : bool
Saves a display
add()  : mixed
Add a display to internal cache
blockCacheService()  : BlockCacheService
Get the block cache service
blockProviderService()  : BlockProvidersService
Get the block providers service
blocksService()  : BlockService
Get the blocks service
displayService()  : DisplayService
Get the display service
eagerLoadingService()  : EagerLoadingService
Get the eager loading service
fieldDisplayersService()  : FieldDisplayerService
Get the field displayers service
fieldsService()  : FieldsService
Get the fields service
fileDisplayerService()  : FileDisplayerService
Get the file displayers service
getForCraftField()  : DisplayInterface|null
Get a display for a craft field and a view mode
getNextOrder()  : int
Get next order in displays for a view mode
groupsService()  : GroupsService
Get the groups service
layoutService()  : LayoutService
Get the layout service
matrixService()  : MatrixService
Get the matrix service
themesRegistry()  : ThemesRegistry
Get the themes registry
triggerEvent()  : mixed
Triggers an event
viewModesService()  : ViewModeService
Get the view mode service
viewService()  : ViewService
Get the view service

Constants

EVENT_AFTER_DELETE

public mixed EVENT_AFTER_DELETE = 'after_delete'

EVENT_BEFORE_APPLY_DELETE

public mixed EVENT_BEFORE_APPLY_DELETE = 'before_apply_delete'

EVENT_BEFORE_DELETE

public mixed EVENT_BEFORE_DELETE = 'before_delete'

EVENT_BEFORE_SAVE

public mixed EVENT_BEFORE_SAVE = 'before_save'

Properties

Methods

cleanUp()

Clean up for view mode, deletes old displays

public cleanUp(array<string|int, mixed> $displays, ViewModeInterface $viewMode) : mixed
Parameters
$displays : array<string|int, mixed>
$viewMode : ViewModeInterface
Return values
mixed

getAll()

Get all displays

public getAll() : Collection
Return values
Collection

handleChanged()

Handles a change in display config

public handleChanged(ConfigEvent $event) : mixed
Parameters
$event : ConfigEvent
Return values
mixed

handleDeleted()

Handles a deletion in display config

public handleDeleted(ConfigEvent $event) : mixed
Parameters
$event : ConfigEvent
Return values
mixed

rebuildConfig()

Respond to rebuild config event

public rebuildConfig(RebuildConfigEvent $e) : mixed
Parameters
$e : RebuildConfigEvent
Return values
mixed

matrixService()

Get the matrix service

protected matrixService() : MatrixService
Return values
MatrixService

triggerEvent()

Triggers an event

protected triggerEvent(string $type, Event $event) : mixed
Parameters
$type : string
$event : Event
Return values
mixed

Search results