Documentation

BackendController extends SystemComponentBackendController
in package

Specific BackendController for this Component.

Use this to easily create a backend view

Tags
copyright

Cloudrexx AG

author

Project Team SS4U info@cloudrexx.com

subpackage

coremodule_pdf

Table of Contents

Properties

$cx  : Cx
Main class instance
$defaultPermission  : Permission
Default permission
$isViewTranslatable  : bool
Whether the current view contains translatable content

Methods

__call()  : mixed
Route methods like getName(), getType(), getDirectory(), etc.
__construct()  : mixed
Creates new controller
getAllViewGeneratorOptions()  : array<string|int, mixed>
This function returns an array which contains the vgOptions array for all entities
getCommands()  : array<string|int, mixed>
Returns a list of available commands (?act=XY)
getPage()  : mixed
This is called by the default ComponentController and does all the repeating work
getParsedCommands()  : array<string|int, mixed>
Returns a unified representation of commands
getSystemComponentController()  : SystemComponentController
Returns the main controller
parseNavigation()  : Sigma
Parse the navigation
parsePage()  : ViewGenerator|null
Use this to parse your backend page
checkAndModifyCmdByPermission()  : mixed
Check and modify the cmd based on the permission
getEntityClassesWithView()  : array<string|int, mixed>
Returns all entities of this component which can have an auto-generated view
getViewGeneratorOptions()  : array<string|int, mixed>
This function returns the ViewGeneration options for a given entityClass
getViewGeneratorParseObjectForEntityClass()  : string|array<string|int, mixed>|object
Returns the object to parse a view with
hasAccess()  : bool
Check the access permission
hasAccessToCommand()  : bool
Check the access permission based on the command
hasEntityData()  : bool
Tells whether the given entity class name has stored entities
hasNoEntityData()  : bool
Tells whether the given entity class name has no stored entities
parseCommands()  : void
Parses the command list into a consistent form
parseCurrentNavItem()  : mixed
Parse the current navigation item
parseEntityClassPage()  : mixed
showOverviewPage()  : bool
Return true here if you want the first tab to be an entity view
showSplash()  : bool
Returns whether to show the splash screen or not. Every module "should" have an introductionary splash screen. This method can be used to define conditions on when to show it.

Properties

Methods

__call()

Route methods like getName(), getType(), getDirectory(), etc.

public __call(string $methodName, array<string|int, mixed> $arguments) : mixed
Parameters
$methodName : string

Name of method to call

$arguments : array<string|int, mixed>

List of arguments for the method to call

Attributes
#[ReturnTypeWillChange]
Return values
mixed

Return value of the method to call

getAllViewGeneratorOptions()

This function returns an array which contains the vgOptions array for all entities

public getAllViewGeneratorOptions([mixed $dataSetIdentifier = '' ]) : array<string|int, mixed>
Parameters
$dataSetIdentifier : mixed = ''
Tags
access

public

Return values
array<string|int, mixed>

getCommands()

Returns a list of available commands (?act=XY)

public getCommands() : array<string|int, mixed>
Return values
array<string|int, mixed>

List of acts

getPage()

This is called by the default ComponentController and does all the repeating work

public getPage(Page $page) : mixed

This loads a template named after current $act and calls parsePage($actTemplate)

Parameters
$page : Page

Resolved page

Tags
todo

$this->cx->getTemplate()->setVariable() should not be called here but in Cx class

global

array $_ARRAYLANG Language data

getParsedCommands()

Returns a unified representation of commands

public getParsedCommands() : array<string|int, mixed>
Return values
array<string|int, mixed>

See description

parsePage()

Use this to parse your backend page

public parsePage(Sigma $template, array<string|int, mixed> $cmd[, mixed &$isSingle = false ]) : ViewGenerator|null

You will get the template located in /View/Template/{CMD}.html You can access Cx class using $this->cx To show messages, use \Message class

Parameters
$template : Sigma

Template for current CMD

$cmd : array<string|int, mixed>

CMD separated by slashes

$isSingle : mixed = false

Wether edit view or not

Return values
ViewGenerator|null

Used ViewGenerator or null

checkAndModifyCmdByPermission()

Check and modify the cmd based on the permission

protected checkAndModifyCmdByPermission(array<string|int, mixed> &$cmd, array<string|int, mixed> $currentCommands) : mixed
Parameters
$cmd : array<string|int, mixed>
$currentCommands : array<string|int, mixed>

getEntityClassesWithView()

Returns all entities of this component which can have an auto-generated view

protected getEntityClassesWithView() : array<string|int, mixed>
Tags
access

protected

Return values
array<string|int, mixed>

getViewGeneratorOptions()

This function returns the ViewGeneration options for a given entityClass

protected getViewGeneratorOptions(mixed $entityClassName[, mixed $dataSetIdentifier = '' ]) : array<string|int, mixed>
Parameters
$entityClassName : mixed

contains the FQCN from entity

$dataSetIdentifier : mixed = ''

if $entityClassName is DataSet, this is used for better partition

Tags
access

protected

global

$_ARRAYLANG

Return values
array<string|int, mixed>

with options

getViewGeneratorParseObjectForEntityClass()

Returns the object to parse a view with

protected getViewGeneratorParseObjectForEntityClass(mixed $entityClassName) : string|array<string|int, mixed>|object

If you overwrite this and return anything else than string, filter will not work

Parameters
$entityClassName : mixed
Return values
string|array<string|int, mixed>|object

An entity class name, entity, array of entities or DataSet

hasAccess()

Check the access permission

protected hasAccess(array<string|int, mixed> $command) : bool
Parameters
$command : array<string|int, mixed>
Return values
bool

hasAccessToCommand()

Check the access permission based on the command

protected hasAccessToCommand([array<string|int, mixed> $commands = array() ]) : bool
Parameters
$commands : array<string|int, mixed> = array()
Return values
bool

hasEntityData()

Tells whether the given entity class name has stored entities

protected hasEntityData(string $entityClassName) : bool

This method is intended for use in showSplash(). Instead of the fully qualified class name the entity name can be specified relative to the component's entity namespace. If $entityClassName does not start with component's entity namespace it is prepended. Therefore only entities within this component's entity namespace can be checked with this method. The component's entity namespace is: \Cx<component_type><component_name>\Model\Entity\

Parameters
$entityClassName : string

Fully qualified entity class name or according to description

Return values
bool

True if entity has data, false otherwise

hasNoEntityData()

Tells whether the given entity class name has no stored entities

protected hasNoEntityData(string $entityClassName) : bool

This method is intended for use in showSplash(). Instead of the fully qualified class name the entity name can be specified relative to the component's entity namespace. If $entityClassName does not start with component's entity namespace it is prepended. Therefore only entities within this component's entity namespace can be checked with this method. The component's entity namespace is: \Cx<component_type><component_name>\Model\Entity\

Parameters
$entityClassName : string

Fully qualified entity class name or according to description

Return values
bool

True if entity has no data, false otherwise

parseCommands()

Parses the command list into a consistent form

protected parseCommands(array<string|int, mixed> &$currentLayer[, bool $firstLayer = true ]) : void

See {$this->getParsedCommands()} for the format $currentLayer is turned into.

Parameters
$currentLayer : array<string|int, mixed>

(reference) CMDs as provided by getCommands()

$firstLayer : bool = true

Defaults to true, is set to false for recursions

parseCurrentNavItem()

Parse the current navigation item

protected parseCurrentNavItem(Sigma $navigation, string $blockName, string $currentCmd, string $mainCmd, bool $isActiveNav, bool $isSubNav) : mixed
Parameters
$navigation : Sigma
$blockName : string
$currentCmd : string
$mainCmd : string
$isActiveNav : bool
$isSubNav : bool
Tags
global

array $_ARRAYLANG

parseEntityClassPage()

protected parseEntityClassPage(mixed $template, mixed $entityClassName, mixed $classIdentifier[, mixed $filter = array() ][, mixed &$isSingle = false ]) : mixed
Parameters
$template : mixed
$entityClassName : mixed
$classIdentifier : mixed
$filter : mixed = array()
$isSingle : mixed = false

showOverviewPage()

Return true here if you want the first tab to be an entity view

protected showOverviewPage() : bool

Use showSplash() instead

Return values
bool

True if overview should be shown, false otherwise


        
On this page

Search results