class Areas extends ApiController implements ApplicationAwareInterface (View source)

Traits

Trait ApplicationAwareTrait A trait used with ApplicationAwareInterface

A port of \Concrete\Controller\Backend\UserInterface\Block::getBlockToEdit functionality that can be more easily included in different situations

A port of \Concrete\Controller\Dialog\Block::validateBlock functionality that can be more easily included in different situations

Trait ApplicationAwareTrait A trait used with ApplicationAwareInterface

Properties

protected Application $app from  ApplicationAwareTrait
protected Request $request from  ApiController

Methods

setApplication(Application $app)

Setter method for the application

__construct(Request $request)

No description

JsonResponse
error($message, int $code = 400)

Returns an error response in the standard Concrete error response format.

Item
transform($object, TransformerAbstract $transformer, string $resourceKey = null)

Transforms an object using the API transformer

deleted(string $objectType, string $id)

No description

array
getBlockToWorkWith(Page $page, string $areaHandle, $blockID)

Given a page, area handle and block ID, retrieves a block to work with. This function exists because if the area in question is global we have to retrieve a block differently and set different data on it.

Block|null
getBlockToEdit(Page $page, Area $area, string $areaHandle, $blockID)

Given a block we do things like ensure the proper version of the page for that block is loaded (and sometimes create a new version); we relate edits to pages if the block is in a stack, etc.

JsonResponse|null
validateBlock(Block $b, array $postBody)

No description

addBlock($pageID, $areaHandle)

No description

deleteBlock($pageID, $areaHandle, $blockID)

No description

updateBlock($pageID, $areaHandle, $blockID)

No description

Details

setApplication(Application $app)

Setter method for the application

Parameters

Application $app

__construct(Request $request)

No description

Parameters

Request $request

protected JsonResponse error($message, int $code = 400)

Returns an error response in the standard Concrete error response format.

Parameters

$message
int $code

Return Value

JsonResponse

Item transform($object, TransformerAbstract $transformer, string $resourceKey = null)

Transforms an object using the API transformer

Parameters

$object
TransformerAbstract $transformer
string $resourceKey

Return Value

Item

deleted(string $objectType, string $id)

No description

Parameters

string $objectType
string $id

array getBlockToWorkWith(Page $page, string $areaHandle, $blockID)

Given a page, area handle and block ID, retrieves a block to work with. This function exists because if the area in question is global we have to retrieve a block differently and set different data on it.

Parameters

Page $page
string $areaHandle
$blockID

Return Value

array

Block|null getBlockToEdit(Page $page, Area $area, string $areaHandle, $blockID)

Given a block we do things like ensure the proper version of the page for that block is loaded (and sometimes create a new version); we relate edits to pages if the block is in a stack, etc.

..

Parameters

Page $page
Area $area
string $areaHandle
$blockID

Return Value

Block|null

JsonResponse|null validateBlock(Block $b, array $postBody)

No description

Parameters

Block $b
array $postBody

Return Value

JsonResponse|null

addBlock($pageID, $areaHandle)

No description

Parameters

$pageID
$areaHandle

deleteBlock($pageID, $areaHandle, $blockID)

No description

Parameters

$pageID
$areaHandle
$blockID

updateBlock($pageID, $areaHandle, $blockID)

No description

Parameters

$pageID
$areaHandle
$blockID