ViewMode
extends Model
in package
implements
ViewModeInterface
Uses
HasDisplays
Class for view modes
Interfaces, Classes and Traits
- ViewModeInterface
- A view mode has displays associated to it, it's associated to a layout.
Table of Contents
- $dateCreated : DateTime
- $dateUpdated : DateTime
- $handle : string
- $id : int
- $layout_id : int
- $name : name
- $uid : string
- $_displays : array<string|int, DisplayInterface>
- $_layout : LayoutInterface
- addDisplay() : mixed
- Add a display to this view mode
- afterValidate() : mixed
- defineRules() : array<string|int, mixed>
- eagerLoad() : array<string|int, string>
- Eager load fields
- fields() : mixed
- getAllDisplays() : array<string|int, mixed>
- getConfig() : array<string|int, mixed>
- Get project config
- getDisplayByHandle() : DisplayInterface|null
- getDisplayByUid() : DisplayInterface|null
- getDisplays() : array<string|int, mixed>
- getDisplaysByHandles() : array<string|int, mixed>
- getDisplaysByUids() : array<string|int, mixed>
- getErrors() : mixed
- getHasErrors() : bool
- Has errors getter
- getLayout() : LayoutInterface
- Get layout object
- getVisibleDisplays() : array<string|int, mixed>
- hasErrors() : mixed
- setDisplays() : mixed
- setLayout() : mixed
- Layout setter
- loadDisplays() : array<string|int, mixed>
Properties
$dateCreated
public
DateTime
$dateCreated
$dateUpdated
public
DateTime
$dateUpdated
$handle
public
string
$handle
$id
public
int
$id
$layout_id
public
int
$layout_id
$name
public
name
$name
$uid
public
string
$uid
$_displays
protected
array<string|int, DisplayInterface>
$_displays
$_layout
protected
LayoutInterface
$_layout
Methods
addDisplay()
Add a display to this view mode
public
addDisplay(DisplayInterface $display) : mixed
Parameters
- $display : DisplayInterface
Tags
Return values
mixed —afterValidate()
public
afterValidate() : mixed
Tags
Return values
mixed —defineRules()
public
defineRules() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —eagerLoad()
Eager load fields
public
eagerLoad([string $prefix = '' ], int $level[, array<string|int, mixed> &$dependencies = [] ]) : array<string|int, string>
Parameters
- $prefix : string = ''
- $level : int
- $dependencies : array<string|int, mixed> = []
-
cache tags
Tags
Return values
array<string|int, string> —fields()
public
fields() : mixed
Tags
Return values
mixed —getAllDisplays()
public
getAllDisplays() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —getConfig()
Get project config
public
getConfig() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —getDisplayByHandle()
public
getDisplayByHandle(string $handle[, bool $onlyRoots = true ][, bool $onlyVisibles = true ]) : DisplayInterface|null
Parameters
- $handle : string
- $onlyRoots : bool = true
- $onlyVisibles : bool = true
Tags
Return values
DisplayInterface|null —getDisplayByUid()
public
getDisplayByUid(string $uid[, bool $onlyRoots = true ][, bool $onlyVisibles = true ]) : DisplayInterface|null
Parameters
- $uid : string
- $onlyRoots : bool = true
- $onlyVisibles : bool = true
Tags
Return values
DisplayInterface|null —getDisplays()
public
getDisplays() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —getDisplaysByHandles()
public
getDisplaysByHandles(array<string|int, mixed> $handles[, bool $onlyRoots = true ][, bool $onlyVisibles = true ]) : array<string|int, mixed>
Parameters
- $handles : array<string|int, mixed>
- $onlyRoots : bool = true
- $onlyVisibles : bool = true
Tags
Return values
array<string|int, mixed> —getDisplaysByUids()
public
getDisplaysByUids(array<string|int, mixed> $uids[, bool $onlyRoots = true ][, bool $onlyVisibles = true ]) : array<string|int, mixed>
Parameters
- $uids : array<string|int, mixed>
- $onlyRoots : bool = true
- $onlyVisibles : bool = true
Tags
Return values
array<string|int, mixed> —getErrors()
public
getErrors([mixed $attribute = null ]) : mixed
Parameters
- $attribute : mixed = null
Tags
Return values
mixed —getHasErrors()
Has errors getter
public
getHasErrors() : bool
Return values
bool —getLayout()
Get layout object
public
getLayout() : LayoutInterface
Tags
Return values
LayoutInterface —getVisibleDisplays()
public
getVisibleDisplays() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —hasErrors()
public
hasErrors([mixed $attribute = null ]) : mixed
Parameters
- $attribute : mixed = null
Tags
Return values
mixed —setDisplays()
public
setDisplays(array<string|int, mixed>|null $displays) : mixed
Parameters
- $displays : array<string|int, mixed>|null
Tags
Return values
mixed —setLayout()
Layout setter
public
setLayout(LayoutInterface $layout) : mixed
Parameters
- $layout : LayoutInterface
Tags
Return values
mixed —loadDisplays()
protected
loadDisplays() : array<string|int, mixed>