JsonPage
in package
implements
JsonAdapter
JSON Adapter for Cx\Core\ContentManager\Model\Entity\Page
Tags
Table of Contents
Interfaces
- JsonAdapter
- JSON Adapter for JSON requests
Properties
- $messages : mixed
- $tz : mixed
- $db : mixed
- $em : mixed
- $fallbacks : mixed
- $logRepo : mixed
- $multipleSetState : mixed
- $nodeRepo : mixed
- $pageRepo : mixed
Methods
- __construct() : mixed
- Constructor
- get() : array<string|int, mixed>
- Sends data to the client
- getAccessableMethods() : array<string|int, mixed>
- Returns an array of method names accessable from a JSON request
- getAccessData() : array<string|int, mixed>
- Returns the access data array
- getDefaultPermissions() : object
- Returns default permission as object
- getHistoryTable() : mixed
- Get the page logs
- getMessagesAsString() : string
- Returns all messages as string
- getName() : string
- Returns the internal name used as identifier for this adapter
- getPathByTarget() : string
- Returns the page path of the given target (node placeholder).
- isBroken() : bool
- Checks if the passed page or its redirect target page is broken.
- loadApplicationTemplate() : array<string|int, mixed>
- load the application template based on the application, cmd and theme name
- multipleSet() : mixed
- Sets multiple pages.
- multipleSetShutdown() : mixed
- readDirs() : array<string|int, mixed>
- read the files under the given path directory
- set() : type
- Handles request from the client
- setPagePreview() : array<string|int, mixed>
- Sets the page object in the session and returns the link to the page (frontend).
- addHistoryEntries() : mixed
- getAliasArray() : array<string|int, string>
- Returns an array of alias slugs
- getFallbackPageArray() : array<string|int, mixed>
- Returns the array representation of a fallback page
- getPageArray() : array<string|int, mixed>
- Creates the page array representation of a page
- validatePageArray() : array<string|int, mixed>
- Returns a validated page array.
Properties
$messages
public
mixed
$messages
$tz
protected
mixed
$tz
$db
private
mixed
$db
= null
$em
private
mixed
$em
= null
$fallbacks
private
mixed
$fallbacks
= array()
$logRepo
private
mixed
$logRepo
= null
$multipleSetState
private
mixed
$multipleSetState
= null
$nodeRepo
private
mixed
$nodeRepo
= null
$pageRepo
private
mixed
$pageRepo
= null
Methods
__construct()
Constructor
public
__construct() : mixed
get()
Sends data to the client
public
get(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
- $params : array<string|int, mixed>
-
Client parameters
Tags
Return values
array<string|int, mixed> —Page as array
getAccessableMethods()
Returns an array of method names accessable from a JSON request
public
getAccessableMethods() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —List of method names
getAccessData()
Returns the access data array
public
getAccessData([type $page = null ]) : array<string|int, mixed>
Parameters
- $page : type = null
-
Unused
Return values
array<string|int, mixed> —Access data
getDefaultPermissions()
Returns default permission as object
public
getDefaultPermissions() : object
Return values
objectgetHistoryTable()
Get the page logs
public
getHistoryTable(array<string|int, mixed> $params) : mixed
Parameters
- $params : array<string|int, mixed>
-
Arguments passed from JsonData
Tags
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
getPathByTarget()
Returns the page path of the given target (node placeholder).
public
getPathByTarget(array<string|int, mixed> $arguments) : string
If the target page doesn't exist, the path of the error page will be returned.
Parameters
- $arguments : array<string|int, mixed>
Return values
string —$path
isBroken()
Checks if the passed page or its redirect target page is broken.
public
isBroken(array<string|int, mixed> $arguments) : bool
Parameters
- $arguments : array<string|int, mixed>
Return values
boolloadApplicationTemplate()
load the application template based on the application, cmd and theme name
public
loadApplicationTemplate() : array<string|int, mixed>
Return values
array<string|int, mixed>multipleSet()
Sets multiple pages.
public
multipleSet(array<string|int, mixed> $params) : mixed
Parameters
- $params : array<string|int, mixed>
-
Client parameters.
multipleSetShutdown()
public
multipleSetShutdown() : mixed
readDirs()
read the files under the given path directory
public
readDirs(string $path) : array<string|int, mixed>
Parameters
- $path : string
Return values
array<string|int, mixed>set()
Handles request from the client
public
set(array<string|int, mixed> $params) : type
Parameters
- $params : array<string|int, mixed>
-
Client parameters
Tags
Return values
typesetPagePreview()
Sets the page object in the session and returns the link to the page (frontend).
public
setPagePreview(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
- $params : array<string|int, mixed>
Return values
array<string|int, mixed> —[link] The link to the page (frontend).
addHistoryEntries()
private
addHistoryEntries(mixed $page, mixed $username, BackendTable $table, mixed $row[, mixed $version = '' ][, mixed $path = '' ]) : mixed
Parameters
- $page : mixed
- $username : mixed
- $table : BackendTable
- $row : mixed
- $version : mixed = ''
- $path : mixed = ''
getAliasArray()
Returns an array of alias slugs
private
getAliasArray(Page $page) : array<string|int, string>
Parameters
- $page : Page
-
Page to get the aliases of
Return values
array<string|int, string>getFallbackPageArray()
Returns the array representation of a fallback page
private
getFallbackPageArray(Node $node, string $lang) : array<string|int, mixed>
Parameters
- $node : Node
-
Node to get the page of
- $lang : string
-
Language code to get the fallback of
Return values
array<string|int, mixed> —Array representing a fallback page
getPageArray()
Creates the page array representation of a page
private
getPageArray(Page $page) : array<string|int, mixed>
Parameters
- $page : Page
-
Page to "arrayify"
Return values
array<string|int, mixed> —Array representing a page
validatePageArray()
Returns a validated page array.
private
validatePageArray(array<string|int, mixed> $page[, bool $initAllFields = true ]) : array<string|int, mixed>
Parameters
- $page : array<string|int, mixed>
- $initAllFields : bool = true
-
By default, the returned
$output
will have set all page properties. Even those not set by$page
. Set tofalse
to only set properties on$output
that are set in$page
.
Return values
array<string|int, mixed> —$output