FacturaScripts

BaseView
in package

Base definition for the views used in ExtendedControllers

Tags
author

Carlos García Gómez [email protected]

author

Jose Antonio Cuello Principal [email protected]

Table of Contents

DEFAULT_TEMPLATE  = 'Master/BaseView.html.twig'
$count  : int
Total count of read rows.
$cursor  : array<string|int, mixed>
Cursor with data from the model display
$icon  : string
$model  : ModelClass
Model to use in this view.
$newCode  : string
Stores the new code from the save() procedure, to use in loadData().
$offset  : int
Stores the offset for the cursor
$order  : array<string|int, mixed>
$settings  : array<string|int, mixed>
$template  : string
$title  : string
View title
$where  : array<string|int, DataBaseWhere>
Stores the where parameters for the cursor.
$columns  : array<string|int, GroupItem>
$modals  : array<string|int, mixed>
$pageOption  : PageOption
Columns configuration
$rows  : array<string|int, mixed>
$name  : string
__construct()  : mixed
Construct and initialize the class
columnForField()  : ColumnItem
Gets the column by the given field name
columnForName()  : ColumnItem
Gets the column by the column name
columnModalForName()  : ColumnItem
Gets the modal column by the column name
disableColumn()  : mixed
Establishes the column's display or read only state.
export()  : bool
Method to export the view data.
getColumns()  : array<string|int, GroupItem>
Returns the column configuration
getModals()  : array<string|int, GroupItem>
Returns the modal configuration
getPagination()  : array<string|int, mixed>
getRow()  : mixed
If it exists, return the specified row type
getViewName()  : string
Returns the name.
loadData()  : mixed
Loads view data.
loadFromData()  : mixed
Verifies the structure and loads into the model the given data array
loadPageOptions()  : mixed
processFormData()  : mixed
Process form data.
assets()  : mixed
Adds assets to the asset manager.
getColumnForName()  : ColumnItem
Gets the column by the column name from source group
getPageWhere()  : mixed
Returns DataBaseWhere[] for locate a pageOption model.

Constants

DEFAULT_TEMPLATE

public mixed DEFAULT_TEMPLATE = 'Master/BaseView.html.twig'

Properties

$count

Total count of read rows.

public int $count = 0

$cursor

Cursor with data from the model display

public array<string|int, mixed> $cursor = []

$newCode

Stores the new code from the save() procedure, to use in loadData().

public string $newCode

$offset

Stores the offset for the cursor

public int $offset = 0

$order

public array<string|int, mixed> $order = []

$settings

public array<string|int, mixed> $settings

$modals

protected array<string|int, mixed> $modals = []

$rows

protected array<string|int, mixed> $rows = []

Methods

__construct()

Construct and initialize the class

public __construct(string $name, string $title, string $modelName, string $icon) : mixed
Parameters
$name : string
$title : string
$modelName : string
$icon : string
Return values
mixed

columnForField()

Gets the column by the given field name

public columnForField(string $fieldName) : ColumnItem
Parameters
$fieldName : string
Return values
ColumnItem

columnForName()

Gets the column by the column name

public columnForName(string $columnName) : ColumnItem
Parameters
$columnName : string
Return values
ColumnItem

columnModalForName()

Gets the modal column by the column name

public columnModalForName(string $columnName) : ColumnItem
Parameters
$columnName : string
Return values
ColumnItem

disableColumn()

Establishes the column's display or read only state.

public disableColumn(string $columnName[, bool $disabled = true ][, string $readOnly = '' ]) : mixed
Parameters
$columnName : string
$disabled : bool = true
$readOnly : string = ''
Return values
mixed

export()

Method to export the view data.

public abstract export(mixed &$exportManager, mixed $codes) : bool
Parameters
$exportManager : mixed
$codes : mixed
Return values
bool

getColumns()

Returns the column configuration

public getColumns() : array<string|int, GroupItem>
Return values
array<string|int, GroupItem>

getModals()

Returns the modal configuration

public getModals() : array<string|int, GroupItem>
Return values
array<string|int, GroupItem>

getPagination()

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

getRow()

If it exists, return the specified row type

public getRow(string $key) : mixed
Parameters
$key : string
Return values
mixed

getViewName()

Returns the name.

public getViewName() : string
Return values
string

loadData()

Loads view data.

public abstract loadData([mixed $code = '' ][, mixed $where = [] ][, mixed $order = [] ], mixed $offset[, mixed $limit = FS_ITEM_LIMIT ]) : mixed
Parameters
$code : mixed = ''
$where : mixed = []
$order : mixed = []
$offset : mixed
$limit : mixed = FS_ITEM_LIMIT
Return values
mixed

loadFromData()

Verifies the structure and loads into the model the given data array

public loadFromData(array<string|int, mixed> &$data) : mixed
Parameters
$data : array<string|int, mixed>
Return values
mixed

loadPageOptions()

public loadPageOptions([User|false $user = false ]) : mixed
Parameters
$user : User|false = false
Return values
mixed

processFormData()

Process form data.

public abstract processFormData(mixed $request, mixed $case) : mixed
Parameters
$request : mixed
$case : mixed
Return values
mixed

assets()

Adds assets to the asset manager.

protected assets() : mixed
Return values
mixed

getColumnForName()

Gets the column by the column name from source group

protected getColumnForName(string $columnName, array<string|int, mixed> &$source) : ColumnItem
Parameters
$columnName : string
$source : array<string|int, mixed>
Return values
ColumnItem

getPageWhere()

Returns DataBaseWhere[] for locate a pageOption model.

protected getPageWhere([User|false $user = false ]) : mixed
Parameters
$user : User|false = false
Return values
mixed

Search results