ViewGeneratorJsonController
extends Controller
in package
implements
JsonAdapter
This is the superclass for all Controller classes
Tags
Table of Contents
Interfaces
- JsonAdapter
- JSON Adapter for JSON requests
Properties
Methods
- __call() : mixed
- Route methods like getName(), getType(), getDirectory(), etc.
- __construct() : mixed
- Creates new controller
- checkWhitelistPermission() : bool
- Checks whether the supplied request info is allowed by the corresponding whitelist
- export() : array<string|int, mixed>
- Exports Doctrine entities to a file
- getAccessableMethods() : array<string|int, mixed>
- Returns an array of method names accessable from a JSON request
- getDefaultPermissions() : object
- Returns default permission as object
- getMessagesAsString() : string
- Returns all messages as string
- getName() : string
- Returns the internal name used as identifier for this adapter
- getSystemComponentController() : SystemComponentController
- Returns the main controller
- getViewOverJson() : json
- Always returns the add view of an entity This is mostly used for oneToMany associations to load the associated entity (in a model)
- updateOrder() : array<string|int, mixed>
- Update the sort order in DB
- updateStatus() : mixed
- Update the status of an entity attribute in DB
Properties
$cx
Main class instance
protected
Cx
$cx
= null
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
__construct()
Creates new controller
public
__construct(SystemComponentController $systemComponentController, Cx $cx) : mixed
Parameters
- $systemComponentController : SystemComponentController
-
Main controller for this system component
- $cx : Cx
-
Main class instance
checkWhitelistPermission()
Checks whether the supplied request info is allowed by the corresponding whitelist
public
checkWhitelistPermission(array<string|int, mixed> $arguments) : bool
This method returns true if all post and get variables specified in a whitelist entry are set and have the same value as specified in the list. $arguments can either be array( 'get' => <getArgs> 'post' => <postArgs> ) or array( 'get' => array( 'get' => <getArgs> 'post' => <postArgs> ) ) This is because JsonAdapter method nesting currently leads to param nesting. <getArgs> needs to have index 0 set to the whitelist identifier. The second form is deprecated and should only be used in order to circumvent the problem described above.
Parameters
- $arguments : array<string|int, mixed>
-
Request info, see method description for more info
Return values
bool —Returns true if request info is allowed by whitelist
export()
Exports Doctrine entities to a file
public
export(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
- $params : array<string|int, mixed>
-
The following get params are allowed: type required string Doctrine entity name search optional VGparam Filters term optional VGparam Search term
Tags
Return values
array<string|int, mixed> —Generated file name
getAccessableMethods()
Returns an array of method names accessable from a JSON request
public
getAccessableMethods() : array<string|int, mixed>
Return values
array<string|int, mixed> —List of method names
getDefaultPermissions()
Returns default permission as object
public
getDefaultPermissions() : object
Return values
objectgetMessagesAsString()
Returns all messages as string
public
getMessagesAsString() : string
Return values
string —HTML encoded error messages
getName()
Returns the internal name used as identifier for this adapter
public
getName() : string
Return values
string —Name of this adapter
getSystemComponentController()
Returns the main controller
public
getSystemComponentController() : SystemComponentController
Return values
SystemComponentController —Main controller for this system component
getViewOverJson()
Always returns the add view of an entity This is mostly used for oneToMany associations to load the associated entity (in a model)
public
getViewOverJson(array<string|int, mixed> $params) : json
Parameters
- $params : array<string|int, mixed>
-
data from ajax request
Tags
Return values
json —rendered form
updateOrder()
Update the sort order in DB
public
updateOrder(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
- $params : array<string|int, mixed>
-
supplied arguments from JsonData-request
Tags
Return values
array<string|int, mixed> —it contains status and record count
updateStatus()
Update the status of an entity attribute in DB
public
updateStatus(array<string|int, mixed> $params) : mixed
Parameters
- $params : array<string|int, mixed>
-
supplied arguments from JsonData-request