class Block extends Tag implements BlockInterface (View source)

Properties

protected AbstractDao $dao from AbstractModel
protected array $options Options of the current tag, can contain some configurations for the editmode, or the thumbnail name, . from Tag
protected string $name from Tag
protected string $realName Contains the real name of the editable without the prefixes and suffixes which are generated automatically by blocks and areablocks from Tag
protected int $documentId Element belongs to the ID of the document from Tag
protected Action $controller from Tag
protected ViewModelInterface|View $view from Tag
protected bool $editmode In Editmode or not from Tag
protected bool $inherited from Tag
array $indices Contains an array of indices, which represent the order of the elements in the block
int $current Current step of the block while iteration
string[] $suffixes

Methods

Dao
getDao()

No description

setDao($dao)

No description

getResource() deprecated

No description

initDao(null $key = null, bool $forceDetection = false)

No description

static string|null
locateDaoClass(string $modelClass)

No description

$this
setValues(array $data = [])

No description

$this
setValue($key, $value)

No description

array
__sleep()

Returns only the properties which should be serialized

from Tag
mixed
__call($method, $args)

No description

__clone()

No description

array
getObjectVars()

returns object values without the dao

array
__debugInfo()

No description

void
beginTransaction()

No description

void
commit()

No description

void
rollBack()

No description

void
configure()

No description

array
getValidTableColumns(string $table, bool $cache)

No description

void
resetValidTableColumnsCache(string $table)

No description

static mixed
factory($type, $name, $documentId, null $config = null, null $controller = null, null $view = null, null $editmode = null)

No description

from Tag
string
admin()

No description

array
getEditmodeOptions()

Builds options passed to editmode frontend as JSON config

from Tag
mixed
getEditmodeData()

Builds data used for editmode

from Tag
array
getEditmodeElementAttributes(array $options)

No description

from Tag
array
getEditmodeElementClasses()

Builds classes used on the editmode HTML element

from Tag
outputEditmode(string $value)

Sends data to the output stream

from Tag
string
outputEditmodeOptions(array $options, bool $return = false)

Push editmode options into the JS config array

from Tag
mixed
getValue()

No description

from Tag
string
getName()

No description

from Tag
$this
setName(string $name)

No description

from Tag
$this
setDocumentId(int $id)

No description

from Tag
int
getDocumentId()

No description

from Tag
array
getOptions()

No description

from Tag
$this
setOptions(array $options)

No description

$this
setController(Action $controller)

No description

from Tag
Action
getController()

No description

from Tag
$this
setView(ViewModelInterface|View $view)

No description

from Tag
getView()

No description

from Tag
string
getRealName()

No description

from Tag
setRealName(string $realName)

No description

from Tag
setParentBlockNames(array $parentNames)

No description

from Tag
getParentBlockNames()

No description

from Tag
string
__toString()

direct output to the frontend

from Tag
bool
getEditmode()

No description

from Tag
$this
setEditmode(bool $editmode)

No description

from Tag
$this
getDataForResource()

No description

from Tag
array
getCacheTags($ownerDocument, array $tags = [])

No description

from Tag
resolveDependencies()

This is a dummy and is mostly implemented by relation types

from Tag
getFromWebserviceImport($wsElement, $document = null, $params = [], $idMapper = null)

No description

array
getForWebserviceExport($document = null, mixed $params = [])

Returns the current tag's data for web service export

from Tag
bool
checkValidity()

No description

from Tag
$this
setInherited($inherited)

No description

from Tag
bool
getInherited()

No description

from Tag
getBlockState()

TODO inject block state via DI

from Tag
static string
buildTagName(string $type, string $name, Document $document = null)

Builds a tag name for an editable, taking current block state (block, index) and targeting into account.

from Tag
static 
buildTagRealName(string $name, Document $document)

No description

from Tag
string
getType()

No description

mixed
getData()

No description

string
frontend()

No description

string
setDataFromResource(mixed $data)

No description

setDataFromEditmode(mixed $data)

No description

$this
setDefault()

No description

bool
loop()

Loops through the block

bool
enumerate() deprecated

Alias for loop

$this
start()

Is executed at the beginning of the loop and setup some general settings

end()

Is executed at the end of the loop and removes the settings set in start()

blockConstruct()

Called before the block is rendered

blockDestruct()

Called when the block was rendered

blockStart()

Is called evertime a new iteration starts (new entry of the block while looping)

blockEnd()

Is called evertime a new iteration ends (new entry of the block while looping)

int
getCount()

Return the amount of block elements

int
getCurrent()

Return current iteration step

int
getCurrentIndex()

Return current index

__wakeup()

If object was serialized, set the counter back to 0

bool
isEmpty()

No description

Item[]
getElements()

No description

Details

Dao getDao()

Return Value

Dao

AbstractModel setDao($dao)

Parameters

$dao

Return Value

AbstractModel

AbstractDao getResource() deprecated

deprecated

Return Value

AbstractDao

initDao(null $key = null, bool $forceDetection = false)

Parameters

null $key
bool $forceDetection

Exceptions

Exception

static string|null locateDaoClass(string $modelClass)

Parameters

string $modelClass

Return Value

string|null

$this setValues(array $data = [])

Parameters

array $data

Return Value

$this

$this setValue($key, $value)

Parameters

$key
$value

Return Value

$this

array __sleep()

Returns only the properties which should be serialized

Return Value

array

mixed __call($method, $args)

Parameters

$method
$args

Return Value

mixed

Exceptions

Exception

__clone()

array getObjectVars()

returns object values without the dao

Return Value

array

array __debugInfo()

Return Value

array

void beginTransaction()

Return Value

void

void commit()

Return Value

void

void rollBack()

Return Value

void

void configure()

Return Value

void

array getValidTableColumns(string $table, bool $cache)

Parameters

string $table
bool $cache

Return Value

array

void resetValidTableColumnsCache(string $table)

Parameters

string $table

Return Value

void

static mixed factory($type, $name, $documentId, null $config = null, null $controller = null, null $view = null, null $editmode = null)

Parameters

$type
$name
$documentId
null $config
null $controller
null $view
null $editmode

Return Value

mixed

string admin()

Return Value

string

See also

TagInterface::admin

protected array getEditmodeOptions()

Builds options passed to editmode frontend as JSON config

Return Value

array

protected mixed getEditmodeData()

Builds data used for editmode

Return Value

mixed

protected array getEditmodeElementAttributes(array $options)

Parameters

array $options

Return Value

array

protected getEditmodeBlockStateAttributes()

protected array getEditmodeElementClasses()

Builds classes used on the editmode HTML element

Return Value

array

protected outputEditmode(string $value)

Sends data to the output stream

Parameters

string $value

protected string outputEditmodeOptions(array $options, bool $return = false)

Push editmode options into the JS config array

Parameters

array $options
bool $return

Return Value

string

mixed getValue()

Return Value

mixed

string getName()

Return Value

string

$this setName(string $name)

Parameters

string $name

Return Value

$this

$this setDocumentId(int $id)

Parameters

int $id

Return Value

$this

int getDocumentId()

Return Value

int

array getOptions()

Return Value

array

$this setOptions(array $options)

Parameters

array $options

Return Value

$this

$this setController(Action $controller)

Parameters

Action $controller

Return Value

$this

Action getController()

Return Value

Action

$this setView(ViewModelInterface|View $view)

Parameters

ViewModelInterface|View $view

Return Value

$this

ViewModelInterface|View getView()

Return Value

ViewModelInterface|View

string getRealName()

Return Value

string

setRealName(string $realName)

Parameters

string $realName

final setParentBlockNames(array $parentNames)

Parameters

array $parentNames

final getParentBlockNames()

string __toString()

direct output to the frontend

Return Value

string

bool getEditmode()

Return Value

bool

$this setEditmode(bool $editmode)

Parameters

bool $editmode

Return Value

$this

$this getDataForResource()

Return Value

$this

array getCacheTags($ownerDocument, array $tags = [])

Parameters

$ownerDocument
array $tags

Return Value

array

resolveDependencies()

This is a dummy and is mostly implemented by relation types

Element getFromWebserviceImport($wsElement, $document = null, $params = [], $idMapper = null)

Parameters

$wsElement
$document
$params
$idMapper

Return Value

Element

Exceptions

Exception

array getForWebserviceExport($document = null, mixed $params = [])

Returns the current tag's data for web service export

Parameters

$document
mixed $params

Return Value

array

bool checkValidity()

Return Value

bool

$this setInherited($inherited)

Parameters

$inherited

Return Value

$this

bool getInherited()

Return Value

bool

protected BlockState getBlockState()

TODO inject block state via DI

Return Value

BlockState

static string buildTagName(string $type, string $name, Document $document = null)

Builds a tag name for an editable, taking current block state (block, index) and targeting into account.

Parameters

string $type
string $name
Document $document

Return Value

string

Exceptions

Exception

static buildTagRealName(string $name, Document $document)

Parameters

string $name
Document $document

string getType()

Return Value

string

See also

TagInterface::getType

mixed getData()

Return Value

mixed

See also

TagInterface::getData

string frontend()

Return Value

string

See also

TagInterface::frontend

string setDataFromResource(mixed $data)

Parameters

mixed $data

Return Value

string

See also

TagInterface::setDataFromResource

setDataFromEditmode(mixed $data)

Parameters

mixed $data

See also

TagInterface::setDataFromEditmode

$this setDefault()

Return Value

$this

bool loop()

Loops through the block

Return Value

bool

bool enumerate() deprecated

deprecated

Alias for loop

Return Value

bool

See also

loop()

$this start()

Is executed at the beginning of the loop and setup some general settings

Return Value

$this

end()

Is executed at the end of the loop and removes the settings set in start()

blockConstruct()

Called before the block is rendered

blockDestruct()

Called when the block was rendered

blockStart()

Is called evertime a new iteration starts (new entry of the block while looping)

blockEnd()

Is called evertime a new iteration ends (new entry of the block while looping)

int getCount()

Return the amount of block elements

Return Value

int

int getCurrent()

Return current iteration step

Return Value

int

int getCurrentIndex()

Return current index

Return Value

int

__wakeup()

If object was serialized, set the counter back to 0

bool isEmpty()

Return Value

bool

Item[] getElements()

Return Value

Item[]