Wizard
extends Controller
in package
Description of Wizard
Table of Contents
Constants
- ITEM_SELECT_LIMIT = 500
- NEW_DEFAULT_PAGE = 'Dashboard'
Properties
- $empresa : Empresa
- Selected company.
- $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.
- $dataBase : DataBase
- It provides direct access to the database.
- $response : Response
- HTTP Response object.
Methods
- __construct() : mixed
- Initialize all objects and properties.
- addExtension() : mixed
- getPageData() : array<string|int, mixed>
- Return the basic data for this page.
- getRegimenIva() : array<string|int, mixed>
- getSelectValues() : array<string|int, mixed>
- Returns an array with all data from selected model.
- getTemplate() : string|false
- Return the template to use for this controller.
- 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.
- request() : Request
- run() : void
- setTemplate() : bool
- Set the template to use for this controller.
- url() : string
- Return the URL of the actual controller.
- db() : DataBase
- finalRedirect() : void
- getClassName() : string
- Return the name of the controller.
- response() : Response
- saveStep3() : void
- validateFormToken() : bool
- Check request token. Returns an error if: - the token does not exist - the token is invalid - the token is duplicated
- initModels() : void
- Initialize required models.
- loadDefaultAccountingPlan() : void
- Loads the default accounting plan. If there is one.
- preSetAppSettings() : void
- Set default AppSettings based on codpais
- saveAddress() : void
- Save company default address.
- saveEmail() : bool
- saveNewPassword() : bool
- Save the new password if data is admin admin
- saveStep1() : void
- saveStep2() : void
- setWarehouse() : void
Constants
ITEM_SELECT_LIMIT
public
mixed
ITEM_SELECT_LIMIT
= 500
NEW_DEFAULT_PAGE
public
mixed
NEW_DEFAULT_PAGE
= 'Dashboard'
Properties
$empresa
Selected company.
public
Empresa
$empresa
$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
$dataBase
It provides direct access to the database.
protected
DataBase
$dataBase
$response
HTTP Response object.
protected
Response
$response
Methods
__construct()
Initialize all objects and properties.
public
__construct(string $className[, string $uri = '' ]) : mixed
Parameters
- $className : string
- $uri : string = ''
addExtension()
public
static addExtension(mixed $extension) : mixed
Parameters
- $extension : mixed
getPageData()
Return the basic data for this page.
public
getPageData() : array<string|int, mixed>
Return values
array<string|int, mixed>getRegimenIva()
public
getRegimenIva() : array<string|int, mixed>
Return values
array<string|int, mixed>getSelectValues()
Returns an array with all data from selected model.
public
getSelectValues(string $modelName[, bool $addEmpty = false ]) : array<string|int, mixed>
Parameters
- $modelName : string
- $addEmpty : bool = false
Return values
array<string|int, mixed>getTemplate()
Return the template to use for this controller.
public
getTemplate() : string|false
Return values
string|falsepipe()
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
request()
public
request() : Request
Return values
Requestrun()
public
run() : void
setTemplate()
Set the template to use for this controller.
public
setTemplate(string|false $template) : bool
Parameters
- $template : string|false
Return values
boolurl()
Return the URL of the actual controller.
public
url() : string
Return values
stringdb()
protected
db() : DataBase
Return values
DataBasefinalRedirect()
protected
finalRedirect() : void
getClassName()
Return the name of the controller.
protected
getClassName() : string
Return values
stringresponse()
protected
response() : Response
Return values
ResponsesaveStep3()
protected
saveStep3() : void
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
boolinitModels()
Initialize required models.
private
initModels(array<string|int, mixed> $names) : void
Parameters
- $names : array<string|int, mixed>
loadDefaultAccountingPlan()
Loads the default accounting plan. If there is one.
private
loadDefaultAccountingPlan(string $codpais) : void
Parameters
- $codpais : string
preSetAppSettings()
Set default AppSettings based on codpais
private
preSetAppSettings(string $codpais) : void
Parameters
- $codpais : string
saveAddress()
Save company default address.
private
saveAddress(string $codpais) : void
Parameters
- $codpais : string
saveEmail()
private
saveEmail(string $email) : bool
Parameters
- $email : string
Return values
boolsaveNewPassword()
Save the new password if data is admin admin
private
saveNewPassword(string $pass) : bool
Parameters
- $pass : string
Return values
bool —Returns true if success, otherwise return false.
saveStep1()
private
saveStep1() : void
saveStep2()
private
saveStep2() : void
setWarehouse()
private
setWarehouse(Almacen $almacen, string $codpais) : void
Parameters
- $almacen : Almacen
- $codpais : string