JsonBlockController
extends Controller
in package
implements
JsonAdapter
JSON Adapter for Block
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
- getAccessableMethods() : array<string|int, mixed>
- Returns an array of method names accessable from a JSON request
- getBlock() : array<string|int, mixed>
- Gets every block attribute for given block and version
- getBlockContent() : string
- Get the block content as html
- getBlocks() : array<string|int, mixed>
- Returns all available blocks for each language
- getCountries() : array<string|int, mixed>
- Get countries from given name
- 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
- getRandomBlockContent() : mixed
- Fetch content for ESI requests of random block widgets
- getSystemComponentController() : SystemComponentController
- Returns the main controller
- saveBlockContent() : bool
- Save the block content
- getVersionValue() : mixed
- Processes and returns value of related block entities stored in block
Properties
$cx
Main class instance
protected
Cx
$cx
= null
$messages
List of messages
protected
array<string|int, mixed>
$messages
= array()
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
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
getBlock()
Gets every block attribute for given block and version
public
getBlock(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
- $params : array<string|int, mixed>
-
all given params from http request
Tags
Return values
array<string|int, mixed> —$blockVersion all attributes from block
getBlockContent()
Get the block content as html
public
getBlockContent(array<string|int, mixed> $params) : string
Parameters
- $params : array<string|int, mixed>
-
all given params from http request
Tags
Return values
string —the html content of the block
getBlocks()
Returns all available blocks for each language
public
getBlocks() : array<string|int, mixed>
Return values
array<string|int, mixed> —List of blocks (lang => id )
getCountries()
Get countries from given name
public
getCountries(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
- $params : array<string|int, mixed>
-
Get parameters,
Return values
array<string|int, mixed> —Array of countries
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
getRandomBlockContent()
Fetch content for ESI requests of random block widgets
public
getRandomBlockContent(mixed $params) : mixed
Parameters
- $params : mixed
Tags
getSystemComponentController()
Returns the main controller
public
getSystemComponentController() : SystemComponentController
Return values
SystemComponentController —Main controller for this system component
saveBlockContent()
Save the block content
public
saveBlockContent(array<string|int, mixed> $params) : bool
Parameters
- $params : array<string|int, mixed>
-
all given params from http request
Tags
Return values
bool —true if everything finished with success
getVersionValue()
Processes and returns value of related block entities stored in block
protected
getVersionValue(mixed $className, mixed $data, mixed $attributes, mixed $idAttributes) : mixed
Parameters
- $className : mixed
-
string full qualified class name to get repo
- $data : mixed
-
array serialized data
- $attributes : mixed
-
array wanted attributes of entity
- $idAttributes : mixed
-
array wanted attributes to get an ID on