Documentation

ViewGeneratorJsonController extends Controller
in package
implements JsonAdapter

This is the superclass for all Controller classes

Tags
copyright

Cloudrexx AG

author

Cloudrexx AG info@cloudrexx.com

subpackage

core_html

Table of Contents

Interfaces

JsonAdapter
JSON Adapter for JSON requests

Properties

$cx  : Cx
Main class instance

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

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

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
todo

This should trigger an async job

todo

ViewGenerator config should be taken into account (exclude fields)

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

getMessagesAsString()

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

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
access

public

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
throws
Exception
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

Tags
throws
Exception

if vars are empty. They have to be defined.

throws
Exception

if entity not found. Entity is needed to store status.

throws
Exception

if setter for status not found


        
On this page

Search results