ForceDocumentUrlTrait
Table of Contents
Properties
- $documentKey : string|null
- The default document primary key.
- $forceUrl : bool
- Indicates if the controller force an url over the resources in the get() and list() methods.
Methods
- initializeForceUrl() : static
- Initialize the owner definition.
- forceDocumentsUrl() : void
- Append an url property on the passed-in document reference.
- forceDocumentUrl() : object|array<string|int, mixed>|null
- Append an url property on the passed-in document reference.
Properties
$documentKey
The default document primary key.
public
string|null
$documentKey
= \oihana\controllers\enums\ControllerParam::ID
$forceUrl
Indicates if the controller force an url over the resources in the get() and list() methods.
public
bool
$forceUrl
= false
Methods
initializeForceUrl()
Initialize the owner definition.
public
initializeForceUrl([array<string|int, mixed> $init = [] ]) : static
Parameters
- $init : array<string|int, mixed> = []
Return values
staticforceDocumentsUrl()
Append an url property on the passed-in document reference.
protected
forceDocumentsUrl(array<string|int, mixed>|null &$documents, string|null $url[, string|null $key = null ][, string $propertyName = ControllerParam::URL ]) : void
Parameters
- $documents : array<string|int, mixed>|null
-
The documents to append.
- $url : string|null
-
The base url to use to generates the url of all documents.
- $key : string|null = null
-
The optional document primary key to use to generates the url of all documents.
- $propertyName : string = ControllerParam::URL
forceDocumentUrl()
Append an url property on the passed-in document reference.
protected
forceDocumentUrl(object|array<string|int, mixed>|null &$document, string|null $url[, string $propertyName = ControllerParam::URL ]) : object|array<string|int, mixed>|null
Parameters
- $document : object|array<string|int, mixed>|null
- $url : string|null
- $propertyName : string = ControllerParam::URL