ListAlmacen
extends ListAlmacen
in package
uses
ExtensionsTrait
Class created by Core/Internal/PluginsDeploy
Table of Contents
Constants
- MODEL_NAMESPACE = '\FacturaScripts\Dinamic\Model\\'
Properties
- $active : string
- Indicates the active view.
- $codeModel : CodeModel
- Model to use with select and autocomplete filters.
- $empresa : Empresa
- Selected company.
- $exportManager : ExportManager
- Object to export data.
- $multiRequestProtection : MultiRequestProtection
- $permissions : ControllerPermissions
- User permissions on this controller.
- $request : Request
- Request on which we can get data.
- $title : string
- Title of the page.
- $uri : string
- Given uri, default is empty.
- $user : User|false
- User logged in.
- $views : array<string|int, BaseView>
- List of views displayed by the controller.
- $dataBase : DataBase
- It provides direct access to the database.
- $extensionCache : array<string|int, mixed>
- Cache for extension lookups by method name.
- $extensions : array<string|int, mixed>
- Stores class extensions.
- $response : Response
- HTTP Response object.
Methods
- __call() : mixed
- Executes the first matched extension.
- __construct() : mixed
- Initializes all the objects and properties.
- addButton() : BaseView
- Adds a new button to the tab.
- addCustomView() : BaseView
- addExtension() : void
- clearExtensions() : void
- Clears all registered extensions.
- getCurrentView() : BaseView
- getExtensions() : array<string|int, mixed>
- Returns a list of all registered extension names.
- getMainViewName() : string
- Returns the name assigned to the main view
- getPageData() : array<string|int, mixed>
- Return the basic data for this page.
- getSettings() : mixed
- Returns the configuration value for the indicated view.
- getTemplate() : string|false
- Return the template to use for this controller.
- getViewModelValue() : mixed
- Return the value for a field in the model of the view.
- hasExtension() : bool
- listView() : ListView
- pipe() : mixed
- pipeFalse() : bool
- privateCore() : mixed
- Runs the controller's private logic.
- publicCore() : mixed
- Execute the public part of the controller.
- redirect() : mixed
- Redirect to an url or controller.
- removeExtension() : bool
- Removes all extensions with the specified name.
- request() : Request
- run() : void
- setCurrentView() : void
- setSettings() : BaseView
- Set value for setting of a view
- setTemplate() : bool
- Set the template to use for this controller.
- tab() : BaseView
- url() : string
- Return the URL of the actual controller.
- addColor() : ListView
- Adds a new color option to the list.
- addFilterAutocomplete() : ListView
- Add an autocomplete type filter to the ListView.
- addFilterCheckbox() : ListView
- Adds a boolean condition type filter to the ListView.
- addFilterDatePicker() : ListView
- Adds a date type filter to the ListView.
- addFilterNumber() : ListView
- Adds a numeric type filter to the ListView.
- addFilterPeriod() : ListView
- Adds a period type filter to the ListView.
- addFilterSelect() : ListView
- Add a select type filter to a ListView.
- addFilterSelectWhere() : ListView
- Add a select where type filter to a ListView.
- addOrderBy() : ListView
- Adds an order field to the ListView.
- addSearchFields() : ListView
- Adds a list of fields to the search in the ListView.
- addView() : ListView
- Creates and adds a ListView to the controller.
- autocompleteAction() : array<string|int, mixed>
- Run the autocomplete action.
- checkOwnerData() : bool
- Returns true if the active user has permission to view the information of the active record in the informed model.
- clearFiltersAction() : void
- Clears the cached filters for the active view.
- createViews() : mixed
- Load views
- createViewWarehouse() : void
- datalistAction() : array<string|int, mixed>
- Run the datalist action.
- db() : DataBase
- deleteAction() : bool
- Action to delete data.
- deleteFilterAction() : void
- Removes the selected page filter.
- execAfterAction() : mixed
- Runs the controller actions after data read.
- execPreviousAction() : bool
- Runs the actions that alter the data before reading it.
- exportAction() : mixed
- getAutocompleteValues() : array<string|int, mixed>
- Return values from Widget Values for autocomplete action
- getClassName() : string
- Return the name of the controller.
- getOwnerFilter() : array<string|int, DataBaseWhere>
- Returns the where filter to apply to obtain the data created by the active user.
- loadData() : mixed
- Loads the data to display.
- megaSearchAction() : void
- Returns a JSON response to MegaSearch.
- requestGet() : array<string|int, mixed>
- Return array with parameters values
- response() : Response
- saveFilterAction() : void
- Saves filter values for active view and user.
- selectAction() : array<string|int, mixed>
- Run the select action.
- validateFormToken() : bool
- Check request token. Returns an error if: - the token does not exist - the token is invalid - the token is duplicated
- buildExtensionCache() : void
- Builds and caches sorted extensions for a method name.
Constants
MODEL_NAMESPACE
public
mixed
MODEL_NAMESPACE
= '\FacturaScripts\Dinamic\Model\\'
Properties
$active
Indicates the active view.
public
string
$active
$codeModel
Model to use with select and autocomplete filters.
public
CodeModel
$codeModel
$empresa
Selected company.
public
Empresa
$empresa
$exportManager
Object to export data.
public
ExportManager
$exportManager
$multiRequestProtection
public
MultiRequestProtection
$multiRequestProtection
$permissions
User permissions on this controller.
public
ControllerPermissions
$permissions
$request
Request on which we can get data.
public
Request
$request
$title
Title of the page.
public
string
$title
título de la página.
$uri
Given uri, default is empty.
public
string
$uri
$user
User logged in.
public
User|false
$user
= false
$views
List of views displayed by the controller.
public
array<string|int, BaseView>
$views
= []
$dataBase
It provides direct access to the database.
protected
DataBase
$dataBase
$extensionCache
Cache for extension lookups by method name.
protected
static array<string|int, mixed>
$extensionCache
= []
$extensions
Stores class extensions.
protected
static array<string|int, mixed>
$extensions
= []
$response
HTTP Response object.
protected
Response
$response
Methods
__call()
Executes the first matched extension.
public
__call(string $name[, array<string|int, mixed> $arguments = [] ]) : mixed
Parameters
- $name : string
- $arguments : array<string|int, mixed> = []
Tags
__construct()
Initializes all the objects and properties.
public
__construct(string $className[, string $uri = '' ]) : mixed
Parameters
- $className : string
- $uri : string = ''
addButton()
Adds a new button to the tab.
public
addButton(string $viewName, array<string|int, mixed> $btnArray) : BaseView
Parameters
- $viewName : string
- $btnArray : array<string|int, mixed>
Return values
BaseViewaddCustomView()
public
addCustomView(string $viewName, BaseView $view) : BaseView
Parameters
- $viewName : string
- $view : BaseView
Return values
BaseViewaddExtension()
public
static addExtension(mixed $extension[, int $priority = 100 ]) : void
Parameters
- $extension : mixed
- $priority : int = 100
-
Priority for all methods in this extension (0-1000, default 100)
clearExtensions()
Clears all registered extensions.
public
static clearExtensions() : void
getCurrentView()
public
getCurrentView() : BaseView
Return values
BaseViewgetExtensions()
Returns a list of all registered extension names.
public
static getExtensions() : array<string|int, mixed>
Return values
array<string|int, mixed>getMainViewName()
Returns the name assigned to the main view
public
getMainViewName() : string
Return values
stringgetPageData()
Return the basic data for this page.
public
getPageData() : array<string|int, mixed>
Return values
array<string|int, mixed>getSettings()
Returns the configuration value for the indicated view.
public
getSettings(string $viewName, string $property) : mixed
Parameters
- $viewName : string
- $property : string
getTemplate()
Return the template to use for this controller.
public
getTemplate() : string|false
Return values
string|falsegetViewModelValue()
Return the value for a field in the model of the view.
public
getViewModelValue(string $viewName, string $fieldName) : mixed
Parameters
- $viewName : string
- $fieldName : string
hasExtension()
public
hasExtension(mixed $name) : bool
Parameters
- $name : mixed
Return values
boollistView()
public
listView(string $viewName) : ListView
Parameters
- $viewName : string
Return values
ListViewpipe()
public
pipe(string $name, array<string|int, mixed> ...$arguments) : mixed
Parameters
- $name : string
- $arguments : array<string|int, mixed>
pipeFalse()
public
pipeFalse(string $name, array<string|int, mixed> ...$arguments) : bool
Parameters
- $name : string
- $arguments : array<string|int, mixed>
Return values
boolprivateCore()
Runs the controller's private logic.
public
privateCore(Response &$response, User $user, ControllerPermissions $permissions) : mixed
Parameters
- $response : Response
- $user : User
- $permissions : ControllerPermissions
publicCore()
Execute the public part of the controller.
public
publicCore(Response &$response) : mixed
Parameters
- $response : Response
redirect()
Redirect to an url or controller.
public
redirect(string $url[, int $delay = 0 ]) : mixed
Parameters
- $url : string
- $delay : int = 0
removeExtension()
Removes all extensions with the specified name.
public
static removeExtension(string $name) : bool
Parameters
- $name : string
Return values
bool —True if at least one extension was removed
request()
public
request() : Request
Return values
Requestrun()
public
run() : void
setCurrentView()
public
setCurrentView(string $viewName) : void
Parameters
- $viewName : string
setSettings()
Set value for setting of a view
public
setSettings(string $viewName, string $property, mixed $value) : BaseView
Parameters
- $viewName : string
- $property : string
- $value : mixed
Return values
BaseViewsetTemplate()
Set the template to use for this controller.
public
setTemplate(string|false $template) : bool
Parameters
- $template : string|false
Return values
booltab()
public
tab(string $viewName) : BaseView
Parameters
- $viewName : string
Return values
BaseViewurl()
Return the URL of the actual controller.
public
url() : string
Return values
stringaddColor()
Adds a new color option to the list.
protected
addColor(string $viewName, string $fieldName, mixed $value, string $color[, string $title = '' ]) : ListView
Parameters
- $viewName : string
- $fieldName : string
- $value : mixed
- $color : string
- $title : string = ''
Return values
ListViewaddFilterAutocomplete()
Add an autocomplete type filter to the ListView.
protected
addFilterAutocomplete(string $viewName, string $key, string $label, string $field, string $table[, string $fieldcode = '' ][, string $fieldtitle = '' ][, array<string|int, mixed> $where = [] ]) : ListView
Parameters
- $viewName : string
- $key : string
-
(Filter identifier)
- $label : string
-
(Human reader description)
- $field : string
-
(Field of the model to apply filter)
- $table : string
-
(Table to search)
- $fieldcode : string = ''
-
(Primary column of the table to search and match)
- $fieldtitle : string = ''
-
(Column to show name or description)
- $where : array<string|int, mixed> = []
-
(Extra where conditions)
Return values
ListViewaddFilterCheckbox()
Adds a boolean condition type filter to the ListView.
protected
addFilterCheckbox(string $viewName, string $key[, string $label = '' ][, string $field = '' ][, string $operation = '=' ][, mixed $matchValue = true ][, array<string|int, DataBaseWhere> $default = [] ]) : ListView
Parameters
- $viewName : string
- $key : string
-
(Filter identifier)
- $label : string = ''
-
(Human reader description)
- $field : string = ''
-
(Field of the model to apply filter)
- $operation : string = '='
-
(operation to perform with match value)
- $matchValue : mixed = true
-
(Value to match)
- $default : array<string|int, DataBaseWhere> = []
-
(where to apply when filter is empty)
Return values
ListViewaddFilterDatePicker()
Adds a date type filter to the ListView.
protected
addFilterDatePicker(string $viewName, string $key[, string $label = '' ][, string $field = '' ][, string $operation = '>=' ]) : ListView
Parameters
- $viewName : string
- $key : string
-
(Filter identifier)
- $label : string = ''
-
(Human reader description)
- $field : string = ''
-
(Field of the table to apply filter)
- $operation : string = '>='
-
(Operation to perform)
Return values
ListViewaddFilterNumber()
Adds a numeric type filter to the ListView.
protected
addFilterNumber(string $viewName, string $key[, string $label = '' ][, string $field = '' ][, string $operation = '>=' ]) : ListView
Parameters
- $viewName : string
- $key : string
-
(Filter identifier)
- $label : string = ''
-
(Human reader description)
- $field : string = ''
-
(Field of the table to apply filter)
- $operation : string = '>='
-
(Operation to perform)
Return values
ListViewaddFilterPeriod()
Adds a period type filter to the ListView.
protected
addFilterPeriod(string $viewName, string $key, string $label, string $field[, bool $dateTime = false ]) : ListView
(period + start date + end date)
Parameters
- $viewName : string
- $key : string
-
(Filter identifier)
- $label : string
-
(Human reader description)
- $field : string
-
(Field of the table to apply filter)
- $dateTime : bool = false
-
(True if the field is a date and time)
Return values
ListViewaddFilterSelect()
Add a select type filter to a ListView.
protected
addFilterSelect(string $viewName, string $key, string $label, string $field[, array<string|int, mixed> $values = [] ]) : ListView
Parameters
- $viewName : string
- $key : string
-
(Filter identifier)
- $label : string
-
(Human reader description)
- $field : string
-
(Field of the table to apply filter)
- $values : array<string|int, mixed> = []
-
(Values to show)
Return values
ListViewaddFilterSelectWhere()
Add a select where type filter to a ListView.
protected
addFilterSelectWhere(string $viewName, string $key, array<string|int, mixed> $values[, string $label = '' ]) : ListView
Parameters
- $viewName : string
- $key : string
-
(Filter identifier)
- $values : array<string|int, mixed>
-
(Values to show)
- $label : string = ''
-
(Human reader description)
Return values
ListView —Example of values: [ ['label' => 'Only active', 'where' => [new DataBaseWhere('suspended', false)]] ['label' => 'Only suspended', 'where' => [new DataBaseWhere('suspended', true)]] ['label' => 'All records', 'where' => []], ]
addOrderBy()
Adds an order field to the ListView.
protected
addOrderBy(string $viewName, array<string|int, mixed> $fields[, string $label = '' ][, int $default = 0 ]) : ListView
Parameters
- $viewName : string
- $fields : array<string|int, mixed>
- $label : string = ''
- $default : int = 0
-
(0 = None, 1 = ASC, 2 = DESC)
Return values
ListViewaddSearchFields()
Adds a list of fields to the search in the ListView.
protected
addSearchFields(string $viewName, array<string|int, mixed> $fields) : ListView
To use integer columns, use CAST(columnName AS CHAR(50)).
Parameters
- $viewName : string
- $fields : array<string|int, mixed>
Return values
ListViewaddView()
Creates and adds a ListView to the controller.
protected
addView(string $viewName, string $modelName[, string $viewTitle = '' ][, string $icon = 'fa-solid fa-search' ]) : ListView
Parameters
- $viewName : string
- $modelName : string
- $viewTitle : string = ''
- $icon : string = 'fa-solid fa-search'
Return values
ListViewautocompleteAction()
Run the autocomplete action.
protected
autocompleteAction() : array<string|int, mixed>
Returns a JSON string for the searched values.
Return values
array<string|int, mixed>checkOwnerData()
Returns true if the active user has permission to view the information of the active record in the informed model.
protected
checkOwnerData(ModelClass $model) : bool
Parameters
- $model : ModelClass
Return values
boolclearFiltersAction()
Clears the cached filters for the active view.
protected
clearFiltersAction() : void
createViews()
Load views
protected
createViews() : mixed
createViewWarehouse()
protected
createViewWarehouse([string $viewName = 'ListAlmacen' ]) : void
Parameters
- $viewName : string = 'ListAlmacen'
datalistAction()
Run the datalist action.
protected
datalistAction() : array<string|int, mixed>
Returns a JSON string for the searched values.
Return values
array<string|int, mixed>db()
protected
db() : DataBase
Return values
DataBasedeleteAction()
Action to delete data.
protected
deleteAction() : bool
Return values
booldeleteFilterAction()
Removes the selected page filter.
protected
deleteFilterAction() : void
execAfterAction()
Runs the controller actions after data read.
protected
execAfterAction(string $action) : mixed
Parameters
- $action : string
execPreviousAction()
Runs the actions that alter the data before reading it.
protected
execPreviousAction(string $action) : bool
Parameters
- $action : string
Return values
boolexportAction()
protected
exportAction() : mixed
getAutocompleteValues()
Return values from Widget Values for autocomplete action
protected
getAutocompleteValues(string $viewName, string $fieldName) : array<string|int, mixed>
Parameters
- $viewName : string
- $fieldName : string
Return values
array<string|int, mixed>getClassName()
Return the name of the controller.
protected
getClassName() : string
Return values
stringgetOwnerFilter()
Returns the where filter to apply to obtain the data created by the active user.
protected
getOwnerFilter(ModelClass $model) : array<string|int, DataBaseWhere>
Parameters
- $model : ModelClass
Return values
array<string|int, DataBaseWhere>loadData()
Loads the data to display.
protected
loadData(string $viewName, BaseView $view) : mixed
Parameters
- $viewName : string
- $view : BaseView
megaSearchAction()
Returns a JSON response to MegaSearch.
protected
megaSearchAction() : void
requestGet()
Return array with parameters values
protected
requestGet(array<string|int, mixed> $keys) : array<string|int, mixed>
Parameters
- $keys : array<string|int, mixed>
Return values
array<string|int, mixed>response()
protected
response() : Response
Return values
ResponsesaveFilterAction()
Saves filter values for active view and user.
protected
saveFilterAction() : void
selectAction()
Run the select action.
protected
selectAction() : array<string|int, mixed>
Returns a JSON string for the searched values.
Return values
array<string|int, mixed>validateFormToken()
Check request token. Returns an error if: - the token does not exist - the token is invalid - the token is duplicated
protected
validateFormToken() : bool
Return values
boolbuildExtensionCache()
Builds and caches sorted extensions for a method name.
private
buildExtensionCache(string $name) : void
Parameters
- $name : string