\Block\Model\EntityBlock

Represents a single "block" within "blocks" table.

Summary

Methods
Properties
Constants
calculateDelta()
renderable()
isAccessible()
isAccessible()
$id
$locale
$roles
$region
$_matchingData
$delta
$pages
$visibility
$handler
$description
No constants found
_getMenu()
_setDescription()
_getRegion()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$id

$id : integer

Type

integer

$locale

$locale : array

Type

array

$roles

$roles : array

Type

array

$region

$region : array

Type

array

$_matchingData

$_matchingData : array

Type

array

$delta

$delta : string

Type

string

$pages

$pages : string

Type

string

$visibility

$visibility : string

Type

string

$handler

$handler : string

Type

string

$description

$description : string

Type

string

Methods

calculateDelta()

calculateDelta() : void

Automatically calculates "delta" for entity's handler.

Delta values must be unique within a handler name. That is, there may exists two rows with delta = 1, but with different handler values.

renderable()

renderable() : boolean

Checks if whether this block can be rendered or not, that is, exists an event listeners for handling block rendering task.

Returns

boolean

isAccessible()

isAccessible(array|null $roles) : boolean

Whether this entity can be accessed by current user.

Parameters

array|null $roles

Array list of roles to checks against to, or NULL to automatically use entity's "roles" property

Returns

boolean —

False if user has no permissions to see this entity due to role restrictions, true otherwise

isAccessible()

isAccessible(array|null $roles) : boolean

Parameters

array|null $roles

Returns

boolean

_getMenu()

_getMenu() : \Cake\Datasource\EntityInterface|null

Gets block's associated block.

Returns

\Cake\Datasource\EntityInterface|null

_setDescription()

_setDescription(string $description) : string

Sanitizes block's description. No HTML allowed.

Parameters

string $description

Block's description

Returns

string

_getRegion()

_getRegion() : \Block\Model\Entity\BlockRegion

Tries to get block's region.

This method is used when finding blocks matching a particular region.

Returns

\Block\Model\Entity\BlockRegion