Documentation

ComponentController extends SystemComponentController

Main controller for DataAccess

Tags
OA\Info

( version="1.0.0", title="Cloudrexx RESTful API", description="The Cloudrexx RESTful API allows access to ...", @OA\Contact( name="Cloudrexx API Support", url="https://www.cloudrexx.com/support", email="info@cloudrexx.com" ), @OA\License(name="CLOUDREXX") )

OA\Server

( url=SWAGGER_API_HOST )

OA\Get

( path="/json/{endpoint}", operationId="getFromEntityList", summary="Get a list of entities of this type", @OA\Parameter( ref="#/components/parameters/endpoint" ), @OA\Parameter( ref="#/components/parameters/apikey" ), @OA\Parameter( ref="#/components/parameters/locale" ), @OA\Parameter( name="order", description="Sorts the output by one or more fields", in="query", required=false, description="Orders the output", @OA\Schema( type="string", pattern="^([a-zA-Z0-9]+/(ASC|DESC)(;|$))+$" ) ), @OA\Parameter( name="filter", description="Filters the output on one or more fields", in="query", required=false, @OA\Schema( type="object", properties={ } ) ), @OA\Parameter( name="limit", description="Limits the output (paging)", in="query", required=false, @OA\Schema( type="string", pattern="^\d+(,\d+)?$" ) ), @OA\Response( response=200, ref="#/components/responses/multiple_success" ), @OA\Response( response="4XX", ref="#/components/responses/error" ) )

see issue https://github.com/OAI/OpenAPI-Specification/issues/892#issuecomment-281449239

OA\Get

( path="/json/{endpoint}/{id}", operationId="getFromEntity", summary="Get a single entity of this type", @OA\Parameter( ref="#/components/parameters/endpoint" ), @OA\Parameter( ref="#/components/parameters/apikey" ), @OA\Parameter( ref="#/components/parameters/locale" ), @OA\Parameter( ref="#/components/parameters/id" ), @OA\Response( response=200, ref="#/components/responses/single_success" ), @OA\Response( response="4XX", ref="#/components/responses/error" ) )

OA\Post

( path="/json/{endpoint}", operationId="postNewEntity", summary="Add new entity. All fields required by the entity need to be passed.", @OA\Parameter( ref="#/components/parameters/endpoint" ), @OA\Parameter( ref="#/components/parameters/apikey" ), @OA\Parameter( ref="#/components/parameters/locale" ), @OA\Parameter( ref="#/components/parameters/id" ), @OA\Response( response=200, ref="#/components/responses/post_success" ), @OA\Response( response="4XX", ref="#/components/responses/error" ) )

OA\Put

( path="/json/{endpoint}/{id}", operationId="updateEntityPut", summary="Update a complete entity by passing all fields required by the entity.", @OA\Parameter( ref="#/components/parameters/endpoint" ), @OA\Parameter( ref="#/components/parameters/apikey" ), @OA\Parameter( ref="#/components/parameters/id" ), @OA\Response( response=200, ref="#/components/responses/putpatch_success" ), @OA\Response( response="4XX", ref="#/components/responses/error" ) )

OA\Patch

( path="/json/{endpoint}/{id}", operationId="updateEntityPatch", summary="Update an entity by passing only changed fields.", @OA\Parameter( ref="#/components/parameters/endpoint" ), @OA\Parameter( ref="#/components/parameters/apikey" ), @OA\Parameter( ref="#/components/parameters/locale" ), @OA\Parameter( ref="#/components/parameters/id" ), @OA\Response( response=200, ref="#/components/responses/putpatch_success" ), @OA\Response( response="4XX", ref="#/components/responses/error" ) )

OA\Delete

( path="/json/{endpoint}/{id}", operationId="deleteEntity", summary="Delete an entity.", @OA\Parameter( ref="#/components/parameters/endpoint" ), @OA\Parameter( ref="#/components/parameters/apikey" ), @OA\Parameter( ref="#/components/parameters/id" ), @OA\Response( response=200, ref="#/components/responses/delete_success" ), @OA\Response( response="4XX", ref="#/components/responses/error" ) )

OA\Components

( @OA\Parameter( name="endpoint", description="One of the endpoints defined for your Cloudrexx instance.", in="path", required=true, @OA\Schema( type="string" ) ), @OA\Parameter( name="apikey", description="API key to grant access", in="query", required=true, @OA\Schema( type="string" ) ), @OA\Parameter( name="locale", description="The frontend locale to get/set translatable fields in.", in="query", required=false, @OA\Schema( type="string" ) ), @OA\Parameter( name="id", description="Serialized ID of an entity", in="path", required=true, @OA\Schema( type="string", ) ), @OA\Response( response="single_success", description="Successful query to an URL that returns a single entity", content={ @OA\MediaType( mediaType="application/json", @OA\Schema( @OA\Property( property="status", type="string", description="success or error" ), @OA\Property( property="meta", type="object", description="Meta info about this request", @OA\Property( property="version", type="object", description="Current version number of returned element. Only present if endpoint supports versioned entities. Key is the entity's ID.", additionalProperties={ "type": "string" } ) ), @OA\Property( property="messages", type="object", description="Lists of messages grouped by type", @OA\Property( property="success", type="array", items={ "type": "string" }, description="List of messages of type 'success'" ), @OA\Property( property="error", type="array", items={ "type": "string" }, description="List of messages of type 'error'" ), @OA\Property( property="info", type="array", items={ "type": "string" }, description="List of messages of type 'info'" ) ), @OA\Property( property="data", type="object", description="All fields of this entity, including relations as specified by the endpoint.", ), example={ "status": "success", "meta": { "request": }, "version": { "de/1": 7 } }, "messages": { }, "data": { "locale": "de", "ref": 1, "name": "Lorem ipsum" } } ) ) } ), @OA\Response( response="multiple_success", description="Successful query to an URL that returns a list of entities", content={ @OA\MediaType( mediaType="application/json", @OA\Schema( @OA\Property( property="status", type="string", description="success or error" ), @OA\Property( property="meta", type="object", description="Meta info about this request", @OA\Property( property="version", type="object", description="Current version number of returned elements. Only present if endpoint supports versioned entities. Key is the entity's ID.", additionalProperties={ "type": "string" } ) ), @OA\Property( property="messages", type="object", description="Lists of messages grouped by type", @OA\Property( property="success", type="array", items={ "type": "string" }, description="List of messages of type 'success'" ), @OA\Property( property="error", type="array", items={ "type": "string" }, description="List of messages of type 'error'" ), @OA\Property( property="info", type="array", items={ "type": "string" }, description="List of messages of type 'info'" ) ), @OA\Property( property="data", type="object", description="All fields of all matching entities, including relations as specified by the endpoint. Grouped and indexed by the entity'd ID.", ), example={ "status": "success", "meta": { "request": }, "version": { "de/1": 7, "de/2": 3 } }, "messages": { }, "data": { "de/1": { "locale": "de", "ref": 1, "name": "Lorem ipsum" }, "de/2": { "locale": "de", "ref": 2, "name": "Dolor sit amet" } } } ) ) } ), @OA\Response( response="error", description="Query can not be satisfied.", content={ @OA\MediaType( mediaType="application/json", @OA\Schema( @OA\Property( property="status", type="string", description="error" ), @OA\Property( property="meta", type="object", description="Meta info about this request", ), @OA\Property( property="messages", type="object", description="Lists of messages grouped by type", @OA\Property( property="success", type="array", items={ "type": "string" }, description="List of messages of type 'success'" ), @OA\Property( property="error", type="array", items={ "type": "string" }, description="List of messages of type 'error'" ), @OA\Property( property="info", type="array", items={ "type": "string" }, description="List of messages of type 'info'" ) ), @OA\Property( property="data", type="object", description="Empty object", ), example={ "status": "error", "meta": { "request": } }, "messages": { "error": { "Access denied" } }, "data": } } ) ) } ), @OA\Response( response="post_success", description="New entity was added.", content={ @OA\MediaType( mediaType="application/json", @OA\Schema( @OA\Property( property="status", type="string", description="ok" ), @OA\Property( property="meta", type="object", description="Meta info about this request", ), @OA\Property( property="messages", type="object", description="Lists of messages grouped by type", @OA\Property( property="success", type="array", items={ "type": "string" }, description="List of messages of type 'success'" ), @OA\Property( property="error", type="array", items={ "type": "string" }, description="List of messages of type 'error'" ), @OA\Property( property="info", type="array", items={ "type": "string" }, description="List of messages of type 'info'" ) ), @OA\Property( property="data", type="object", description="List of identifier fields of the newly created entity.", ), example={ "status": "ok", "meta": { "request": }, "version": { "de/3": 1 } }, "messages": { }, "data": { "locale": "de", "ref": 3, } } ) ) } ), @OA\Response( response="putpatch_success", description="Entity was updated.", content={ @OA\MediaType( mediaType="application/json", @OA\Schema( @OA\Property( property="status", type="string", description="ok" ), @OA\Property( property="meta", type="object", description="Meta info about this request", ), @OA\Property( property="messages", type="object", description="Lists of messages grouped by type", @OA\Property( property="success", type="array", items={ "type": "string" }, description="List of messages of type 'success'" ), @OA\Property( property="error", type="array", items={ "type": "string" }, description="List of messages of type 'error'" ), @OA\Property( property="info", type="array", items={ "type": "string" }, description="List of messages of type 'info'" ) ), @OA\Property( property="data", type="object", description="Empty object", ), example={ "status": "ok", "meta": { "request": }, "version": { "de/3": 1 } }, "messages": { }, "data": } } ) ) } ), @OA\Response( response="delete_success", description="Entity was deleted.", content={ @OA\MediaType( mediaType="application/json", @OA\Schema( @OA\Property( property="status", type="string", description="ok" ), @OA\Property( property="meta", type="object", description="Meta info about this request", ), @OA\Property( property="messages", type="object", description="Lists of messages grouped by type", @OA\Property( property="success", type="array", items={ "type": "string" }, description="List of messages of type 'success'" ), @OA\Property( property="error", type="array", items={ "type": "string" }, description="List of messages of type 'error'" ), @OA\Property( property="info", type="array", items={ "type": "string" }, description="List of messages of type 'info'" ) ), @OA\Property( property="data", type="object", description="Empty object", ), example={ "status": "ok", "meta": { "request": } }, "messages": { }, "data": } } ) ) } ) )

copyright

Cloudrexx AG

author

Michael Ritter michael.ritter@cloudrexx.com

subpackage

core_modules_dataaccess

Table of Contents

Constants

ERROR_MESSAGE  = 'Exception of type "%s" with message "%s"'
MAIN_ACCESS_ID  = 205
MIN_KEY_LENGTH  = 32

Properties

$config  : array<string|int, mixed>
Config loaded from YAML
$cx  : Cx
Main class instance
$developerDocumentationUrl  : string
URL pointing to the developer documentation for this component
$enduserDocumentationUrl  : string
URL pointing to the end-user documentation for this component
$systemComponent  : SystemComponent
Decorated SystemComponent
$templateDocumentationUrl  : string
URL pointing to the template definitions for this component

Methods

__call()  : mixed
Decoration: all methods that are not specified in this or child classes call the corresponding method of the decorated SystemComponent
__construct()  : mixed
Initializes a controller
adjustResponse()  : mixed
Do something with a Response object You may do page alterations here (like changing the metatitle) You may do response alterations here (like set headers) PLEASE MAKE SURE THIS METHOD IS MOCKABLE. IT MAY ONLY INTERACT WITH resolve() HOOK.
apiV1()  : void
Version 1 of Cloudrexx RESTful API
executeCommand()  : void
Execute one of the commands listed in getCommandsForCommandMode()
getCommandDescription()  : string
Returns the description for a command provided by this component
getCommandsForCommandMode()  : array<string|int, mixed>
Returns a list of command mode commands provided by this component
getComponent()  : SystemComponentController
Get component controller object
getConfigValue()  : string
Returns a value from the config tree
getConfigValues()  : array<string|int, mixed>
Returns part of the config tree
getController()  : Controller
Returns a controller instance if one already exists
getControllerClasses()  : array<string|int, mixed>
Returns all Controller class names for this component (except this)
getControllers()  : array<string|int, mixed>
Returns a list of controllers
getControllersAccessableByJson()  : array<string|int, mixed>
Returns a list of JsonAdapter class names
getDataSource()  : DataSource
Returns the data source with the given name
getDeveloperDocumentationUrl()  : string
Returns the URL pointing to the developer documentation of this component.
getEnduserDocumentationUrl()  : string
Returns the URL pointing to the end-user documentation for this component.
getOutputModule()  : OutputController
Returns the output module with the given name
getSystemComponent()  : SystemComponent
Returns the SystemComponent this Controller decorates
getSystemComponentController()  : SystemComponentController
Returns the main controller
getTemplateDocumentationUrl()  : string
Returns the URL pointing to the template documentation for this component.
hasAccessToExecuteCommand()  : bool
Check whether the command has access to execute or not.
load()  : mixed
Load your component. It is needed for this request.
postComponentLoad()  : mixed
Do something after all active components are loaded USE CAREFULLY, DO NOT DO ANYTHING COSTLY HERE! CALCULATE YOUR STUFF AS LATE AS POSSIBLE.
postContentLoad()  : mixed
Do something after content is loaded from DB
postContentParse()  : mixed
Do something after a module is loaded
postFinalize()  : mixed
Do something after main template got parsed
postInit()  : mixed
Do something after system initialization
postResolve()  : mixed
Do something after resolving is done
preComponentLoad()  : mixed
Do something before component load * USE CAREFULLY, DO NOT DO ANYTHING COSTLY HERE! CALCULATE YOUR STUFF AS LATE AS POSSIBLE.
preContentLoad()  : mixed
Do something before content is loaded from DB
preContentParse()  : mixed
Do something before a module is loaded
preFinalize()  : mixed
Do something before main template gets parsed
preInit()  : mixed
Do something before system initialization
preResolve()  : mixed
Do something before resolving is done
registerController()  : null
Registers a controller instance
registerEventListeners()  : mixed
Register your event listeners here
registerEvents()  : mixed
Register your events here
resolve()  : mixed
Called for additional, component specific resolving
setSystemComponent()  : SystemComponent
Sets the SystemComponent this Controller decorates
adjustFullyQualifiedClassName()  : string
This makes sure a FQCN does not contain double backslashes
fixMultilineDoc()  : string
Fix multilines from API documentation
generateApiDoc()  : mixed
Outputs the swagger.json file for the current installation
getControllerClassName()  : string
This finds the correct FQCN for a controller name
loadConfigFile()  : array<string|int, mixed>
Loads a config YAML file
loadData()  : void
Load data from Component.yml

Constants

ERROR_MESSAGE

public string ERROR_MESSAGE = 'Exception of type "%s" with message "%s"'

Message for exceptions forwarded to API

Properties

$developerDocumentationUrl

URL pointing to the developer documentation for this component

protected string $developerDocumentationUrl = 'https://dev.cloudrexx.com/RESTful%20API/'

Developer documentation URL

Tags
inheritdoc

$enduserDocumentationUrl

URL pointing to the end-user documentation for this component

protected string $enduserDocumentationUrl = 'https://support.cloudrexx.com/api'

End-user documentation URL

Tags
inheritdoc

$templateDocumentationUrl

URL pointing to the template definitions for this component

protected string $templateDocumentationUrl = ''

Template documentation URL

Methods

__call()

Decoration: all methods that are not specified in this or child classes call the corresponding method of the decorated SystemComponent

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

adjustResponse()

Do something with a Response object You may do page alterations here (like changing the metatitle) You may do response alterations here (like set headers) PLEASE MAKE SURE THIS METHOD IS MOCKABLE. IT MAY ONLY INTERACT WITH resolve() HOOK.

public adjustResponse(Response $response) : mixed
Parameters
$response : Response

Response object to adjust

Tags
todo

This is currently only available in "frontend" mode.

apiV1()

Version 1 of Cloudrexx RESTful API

public apiV1(string $command, array<string|int, mixed> $arguments, mixed $dataArguments) : void
Parameters
$command : string

Name of command to execute

$arguments : array<string|int, mixed>

List of arguments for the command

$dataArguments : mixed

executeCommand()

Execute one of the commands listed in getCommandsForCommandMode()

public executeCommand(string $command, array<string|int, mixed> $arguments[, array<string|int, mixed> $dataArguments = array() ]) : void

(/)/api/v1/<outputModule>/<dataSource>/[(?apikey=(&))|?]

Parameters
$command : string

Name of command to execute

$arguments : array<string|int, mixed>

List of arguments for the command

$dataArguments : array<string|int, mixed> = array()

(optional) List of data arguments for the command

Tags
see
getCommandsForCommandMode()

getCommandDescription()

Returns the description for a command provided by this component

public getCommandDescription(string $command[, bool $short = false ]) : string
Parameters
$command : string

The name of the command to fetch the description from

$short : bool = false

Wheter to return short or long description

Return values
string

Command description

getCommandsForCommandMode()

Returns a list of command mode commands provided by this component

public getCommandsForCommandMode() : array<string|int, mixed>
Return values
array<string|int, mixed>

List of command names

getConfigValue()

Returns a value from the config tree

public getConfigValue(string $key) : string
Parameters
$key : string

Slash-separated path to requested branch

Tags
throws
Exception

If the requested branch was not found in config

throws
Exception

If the value is not a leaf but a branch

Return values
string

Requested value as string

getConfigValues()

Returns part of the config tree

public getConfigValues(string $key) : array<string|int, mixed>
Parameters
$key : string

Slash-separated path to requested branch

Tags
throws
Exception

If the requested branch was not found in config

throws
Exception

If the value found is not an array

Return values
array<string|int, mixed>

Requested values

getController()

Returns a controller instance if one already exists

public getController(mixed $controllerClass) : Controller
Parameters
$controllerClass : mixed

Short or FQCN controller name

Tags
throws
Exception

if controller exists but cannot be loaded

Return values
Controller

Controller instance

getControllerClasses()

Returns all Controller class names for this component (except this)

public getControllerClasses() : array<string|int, mixed>

Be sure to return all your controller classes if you add your own

Return values
array<string|int, mixed>

List of Controller class names (without namespace)

getControllers()

Returns a list of controllers

public getControllers([bool $loadedOnly = true ]) : array<string|int, mixed>
Parameters
$loadedOnly : bool = true

(optional) If false, controller that did not register are instanciated, default true

Return values
array<string|int, mixed>

List of Controller instances

getControllersAccessableByJson()

Returns a list of JsonAdapter class names

public getControllersAccessableByJson() : array<string|int, mixed>
Tags
inheritDoc
Return values
array<string|int, mixed>

List of ComponentController classes

getDeveloperDocumentationUrl()

Returns the URL pointing to the developer documentation of this component.

public getDeveloperDocumentationUrl() : string
Return values
string

URL pointing to the developer documentation

getEnduserDocumentationUrl()

Returns the URL pointing to the end-user documentation for this component.

public getEnduserDocumentationUrl() : string
Return values
string

URL pointing to the end-user documentation or empty string

getTemplateDocumentationUrl()

Returns the URL pointing to the template documentation for this component.

public getTemplateDocumentationUrl() : string
Return values
string

URL pointing to the template documentation or empty string

hasAccessToExecuteCommand()

Check whether the command has access to execute or not.

public hasAccessToExecuteCommand(string $command, array<string|int, mixed> $arguments) : bool
Parameters
$command : string

name of the command to execute

$arguments : array<string|int, mixed>

list of arguments for the command

Return values
bool

load()

Load your component. It is needed for this request.

public load(Page $page) : mixed

This loads your FrontendController or BackendController depending on the mode Cx runs in. For modes other than frontend and backend, nothing is done. If you you'd like to name your Controllers differently, or have another use case, overwrite this.

Parameters
$page : Page

The resolved page

postComponentLoad()

Do something after all active components are loaded USE CAREFULLY, DO NOT DO ANYTHING COSTLY HERE! CALCULATE YOUR STUFF AS LATE AS POSSIBLE.

public postComponentLoad() : mixed

postContentLoad()

Do something after content is loaded from DB

public postContentLoad(Page $page) : mixed

USE CAREFULLY, DO NOT DO ANYTHING COSTLY HERE! CALCULATE YOUR STUFF AS LATE AS POSSIBLE

Parameters
$page : Page

The resolved page

postContentParse()

Do something after a module is loaded

public postContentParse(Page $page) : mixed

This method is called only if any module gets loaded for content parsing USE CAREFULLY, DO NOT DO ANYTHING COSTLY HERE! CALCULATE YOUR STUFF AS LATE AS POSSIBLE

Parameters
$page : Page

The resolved page

postFinalize()

Do something after main template got parsed

public postFinalize(string &$endcode) : mixed

USE CAREFULLY, DO NOT DO ANYTHING COSTLY HERE!

Parameters
$endcode : string

The processed data to be sent to the client as response

postInit()

Do something after system initialization

public postInit(Cx $cx) : mixed

USE CAREFULLY, DO NOT DO ANYTHING COSTLY HERE! CALCULATE YOUR STUFF AS LATE AS POSSIBLE. This event must be registered in the postInit-Hook definition file config/postInitHooks.yml.

Parameters
$cx : Cx

The instance of \Cx\Core\Core\Controller\Cx

postResolve()

Do something after resolving is done

public postResolve(Page $page) : mixed

USE CAREFULLY, DO NOT DO ANYTHING COSTLY HERE! CALCULATE YOUR STUFF AS LATE AS POSSIBLE

Parameters
$page : Page

The resolved page

preComponentLoad()

Do something before component load * USE CAREFULLY, DO NOT DO ANYTHING COSTLY HERE! CALCULATE YOUR STUFF AS LATE AS POSSIBLE.

public preComponentLoad() : mixed

This event must be registered in the preComponentLoad-Hook definition file config/preComponentLoadHooks.yml.

preContentLoad()

Do something before content is loaded from DB

public preContentLoad(Page $page) : mixed

USE CAREFULLY, DO NOT DO ANYTHING COSTLY HERE! CALCULATE YOUR STUFF AS LATE AS POSSIBLE

Parameters
$page : Page

The resolved page

preContentParse()

Do something before a module is loaded

public preContentParse(Page $page) : mixed

This method is called only if any module gets loaded for content parsing USE CAREFULLY, DO NOT DO ANYTHING COSTLY HERE! CALCULATE YOUR STUFF AS LATE AS POSSIBLE

Parameters
$page : Page

The resolved page

preFinalize()

Do something before main template gets parsed

public preFinalize(Sigma $template) : mixed

USE CAREFULLY, DO NOT DO ANYTHING COSTLY HERE! CALCULATE YOUR STUFF AS LATE AS POSSIBLE

Parameters
$template : Sigma

The main template

preInit()

Do something before system initialization

public preInit(Cx $cx) : mixed

USE CAREFULLY, DO NOT DO ANYTHING COSTLY HERE! CALCULATE YOUR STUFF AS LATE AS POSSIBLE. This event must be registered in the preInit-Hook definition file config/preInitHooks.yml.

Parameters
$cx : Cx

The instance of \Cx\Core\Core\Controller\Cx

preResolve()

Do something before resolving is done

public preResolve(Url $request) : mixed

USE CAREFULLY, DO NOT DO ANYTHING COSTLY HERE! CALCULATE YOUR STUFF AS LATE AS POSSIBLE

Parameters
$request : Url

The URL object for this request

registerEventListeners()

Register your event listeners here

public registerEventListeners() : mixed
Tags
inheritDoc

registerEvents()

Register your events here

public registerEvents() : mixed

Do not do anything else here than list statements like $this->cx->getEvents()->addEvent($eventName);

resolve()

Called for additional, component specific resolving

public resolve(array<string|int, mixed> $parts, Page $page) : mixed

If /en/Path/to/Page is the path to a page for this component a request like /en/Path/to/Page/with/some/parameters will give an array like array('with', 'some', 'parameters') for $parts PLEASE MAKE SURE THIS METHOD IS MOCKABLE. IT MAY ONLY INTERACT WITH adjustResponse() HOOK.

This may be used to redirect to another page

Parameters
$parts : array<string|int, mixed>

List of additional path parts

$page : Page

Resolved virtual page

adjustFullyQualifiedClassName()

This makes sure a FQCN does not contain double backslashes

protected adjustFullyQualifiedClassName(string $className) : string
Parameters
$className : string

FQCN of a controller

Return values
string

Clean FQCN of a controller

fixMultilineDoc()

Fix multilines from API documentation

protected fixMultilineDoc(string $doc) : string

The current implementation of the OpenAPI documentation parser does not support multiline. See https://github.com/zircote/swagger-php/issues/326 As multilines are required to make use of markdown in the documentation, we do have to fix it manually. Note: multiline support might get added in an upcoming version of the OpenAPI parser (see https://github.com/doctrine/annotations/pull/75).

Parameters
$doc : string

The API documentation to fix.

Tags
todo

Drop this method as soon as the OpenAPI parser does support multilines.

Return values
string

The fixed string.

generateApiDoc()

Outputs the swagger.json file for the current installation

protected generateApiDoc([bool $forceRegen = false ]) : mixed

If $forceRegen is not set to true, the file will be (re)generated if:

  • it does not yet exist /tmp/swagger.json
  • it is older than ??
Parameters
$forceRegen : bool = false

(optional) If set to true file is always regenerated

Tags
todo

Implement "older than"...

getControllerClassName()

This finds the correct FQCN for a controller name

protected getControllerClassName(string $controllerClassShort) : string
Parameters
$controllerClassShort : string

Short name for controller

Return values
string

Fully qualified controller class name

loadConfigFile()

Loads a config YAML file

protected loadConfigFile(string $filename) : array<string|int, mixed>
Parameters
$filename : string

Name of the file to load

Tags
throws
Exception

If the file could not be loaded correctly

Return values
array<string|int, mixed>

Loaded data


        
On this page

Search results