Folder
extends Master
in package
implements
WithIncludes
Folder widget
Implements the REST interfaces to handle folder and assignment administration. Additionally, this widget is used for domain setup and asset database functions.
Tags
Interfaces, Classes, Traits and Enums
Table of Contents
- $request : Request|null
- $endpoint : Endpoint|null
- $response : Response|null
- $setup : Widget|null
- $git_repo : array<string|int, mixed>
- __construct() : mixed
- Needs to be there even if it is empty
- AccessLoad() : mixed
- load access rules provide access to the access list a group has on a certain folder this endpoint is deep secured and uses the values from _GET
- AccessUpdate() : void
- update access sets provides an interface to modify a single folder access list, this function is secured by access levels
- addRelation() : void
- AssignOrphaned() : void
- call() : mixed
- ConvertContent() : mixed
- copySingleRelation() : mixed
- CorsDomainConfig() : void
- create() : mixed
- DeleteAssetDerivative() : mixed
- DeleteOrphaned() : void
- deleteSingleRelation() : void
- DirectoryBatch() : void
- Download() : void
- drop() : mixed
- EmployeeFetchContentRelations() : mixed
- EmployeeFetchSingleRelation() : mixed
- EmployeeFolderTree() : void
- EmployeeUpdateContent() : void
- Endpoint() : Endpoint|null
- Get/Set endpoint
- ExportTree() : mixed
- fetch() : void
- FetchContentRelations() : mixed
- FetchElementsProcessed() : mixed
- fetchSingleAssetDerivatives() : void
- FetchSingleAssetProgress() : void
- fetchSingleRelation() : mixed
- FolderTree() : void
- GetDomainConfig() : mixed
- GetDomainConfigPreset() : void
- GetOrphaned() : void
- GetOrphanedPreview() : void
- GitRepo() : Git
- Git object
- ImportExecute() : void
- ImportPreset() : void
- ImportTree() : void
- LoadTemplate() : void
- LoadTypesWithAssetList() : void
- moveSingleRelation() : mixed
- RecalculateDerivatives() : mixed
- RecalculateImageRotation() : mixed
- RegisterIncludes() : array<string|int, mixed>
- Register includes on add the widget to certain page
- ReplaceAssetDerivative() : mixed
- Request() : Request
- The request Sets or gets the widget request object
- ResolveDomain() : void
- Response() : Response
- Response object Get / Set the widget response
- SaveDomainConfig() : mixed
- SearchOrphaned() : void
- Setup() : Widget|null
- Get/Set the widget context
- update() : void
- updateContent() : void
- UpdateOrphaned() : mixed
- updateSingleRelation() : mixed
- update relation provides an interface to modify a single relation, this function is secured by access levels
- ConfigGet() : void
- Get a configuration by name
- ConfigGetPreset() : void
- Get the configuration preset data
- ConfigGetRaw() : Result
- Get configuration data as object from setup handler
- ConfigSave() : void
- Store a configuration with values from body and a given name
- CopyEntity() : void
- copy a single content links the frontend to the copy handler for single contents identified by rest end point argument
- CreateEntity() : mixed
- create new object
- deleteEntity() : void
- Delete a single content
- fetchAssignedEntityList() : mixed
- fetchEntityList() : void
- Fetch list of entries Use the direct loader method to retrieve a list obf objects
- fetchEntityListFiltered() : void
- Fetch filtered list
- fetchObject() : BaseContent|bool|null
- Retrieve an object from storage
- handleSubViewList() : mixed
- Handle the list/object loading for sub view of contents
- loadSingleEntity() : void
- load a single content implements the loader for single contents identified by rest end point argument
- prepareObjectLogs() : void
- Prepare the object comment and arguments for changes in diff
- UpdateEntity() : void
- Update a single content
- employeeOwnsContent() : bool
- employeeRootFolders() : array<string|int, Folder>
- exportAsset() : mixed
- Download the asset main file or,resolve the object
- exportTreeRecursive() : mixed
- Helper to export a folder tree with full structure
- folderObject() : mixed
- getRawObject() : Asset|BaseContent|null
- Fetch a raw content
- moveOrCopySingleRelation() : mixed
- Copy or, move a relation with its content
- openOrphaned() : BaseContent|null
- Open a dedicated content that is orphaned
Properties
$request
public
Request|null
$request
= null
$endpoint
protected
Endpoint|null
$endpoint
= null
$response
protected
Response|null
$response
= null
$setup
protected
Widget|null
$setup
= null
$git_repo
private
array<string|int, mixed>
$git_repo
= array()
Methods
__construct()
Needs to be there even if it is empty
public
__construct() : mixed
Return values
mixed —AccessLoad()
load access rules provide access to the access list a group has on a certain folder this endpoint is deep secured and uses the values from _GET
public
AccessLoad() : mixed
Return values
mixed —AccessUpdate()
update access sets provides an interface to modify a single folder access list, this function is secured by access levels
public
AccessUpdate() : void
Return values
void —addRelation()
public
addRelation() : void
Return values
void —AssignOrphaned()
public
AssignOrphaned() : void
Return values
void —call()
public
call() : mixed
Return values
mixed —ConvertContent()
public
ConvertContent() : mixed
Return values
mixed —copySingleRelation()
public
copySingleRelation() : mixed
Return values
mixed —CorsDomainConfig()
public
CorsDomainConfig() : void
Return values
void —create()
public
create() : mixed
Return values
mixed —DeleteAssetDerivative()
public
DeleteAssetDerivative() : mixed
Return values
mixed —DeleteOrphaned()
public
DeleteOrphaned() : void
Return values
void —deleteSingleRelation()
public
deleteSingleRelation() : void
Return values
void —DirectoryBatch()
public
DirectoryBatch() : void
Return values
void —Download()
public
Download() : void
Return values
void —drop()
public
drop() : mixed
Return values
mixed —EmployeeFetchContentRelations()
public
EmployeeFetchContentRelations() : mixed
Return values
mixed —EmployeeFetchSingleRelation()
public
EmployeeFetchSingleRelation() : mixed
Return values
mixed —EmployeeFolderTree()
public
EmployeeFolderTree() : void
Return values
void —EmployeeUpdateContent()
public
EmployeeUpdateContent() : void
Return values
void —Endpoint()
Get/Set endpoint
public
Endpoint([Endpoint|null $endpoint = null ]) : Endpoint|null
Sets or gets the widget arguments, they contain the endpoint this widget was called at
Parameters
- $endpoint : Endpoint|null = null
-
A system request list
Return values
Endpoint|null —A system endpoint object
ExportTree()
public
ExportTree() : mixed
Return values
mixed —fetch()
public
fetch() : void
Return values
void —FetchContentRelations()
public
FetchContentRelations() : mixed
Return values
mixed —FetchElementsProcessed()
public
FetchElementsProcessed() : mixed
Return values
mixed —fetchSingleAssetDerivatives()
public
fetchSingleAssetDerivatives() : void
Return values
void —FetchSingleAssetProgress()
public
FetchSingleAssetProgress() : void
Return values
void —fetchSingleRelation()
public
fetchSingleRelation() : mixed
Return values
mixed —FolderTree()
public
FolderTree() : void
Return values
void —GetDomainConfig()
public
GetDomainConfig() : mixed
Return values
mixed —GetDomainConfigPreset()
public
GetDomainConfigPreset() : void
Return values
void —GetOrphaned()
public
GetOrphaned() : void
Return values
void —GetOrphanedPreview()
public
GetOrphanedPreview() : void
Return values
void —GitRepo()
Git object
public
GitRepo([string $path = 'data' ]) : Git
Gets the widget git instance, either for config or, for data repo
Parameters
- $path : string = 'data'
-
The target repo, default is data
Return values
Git —A system git object with data folder as start point
ImportExecute()
public
ImportExecute() : void
Return values
void —ImportPreset()
public
ImportPreset() : void
Return values
void —ImportTree()
public
ImportTree() : void
Return values
void —LoadTemplate()
public
LoadTemplate() : void
Return values
void —LoadTypesWithAssetList()
public
LoadTypesWithAssetList() : void
Return values
void —moveSingleRelation()
public
moveSingleRelation() : mixed
Return values
mixed —RecalculateDerivatives()
public
RecalculateDerivatives() : mixed
Return values
mixed —RecalculateImageRotation()
public
RecalculateImageRotation() : mixed
Return values
mixed —RegisterIncludes()
Register includes on add the widget to certain page
public
RegisterIncludes(Request $request) : array<string|int, mixed>
Parameters
- $request : Request
Return values
array<string|int, mixed> —ReplaceAssetDerivative()
public
ReplaceAssetDerivative() : mixed
Return values
mixed —Request()
The request Sets or gets the widget request object
public
Request([Request|null $request = null ]) : Request
Parameters
- $request : Request|null = null
-
A system request object
Return values
Request —A system request object
ResolveDomain()
public
ResolveDomain() : void
Return values
void —Response()
Response object Get / Set the widget response
public
Response([Response|null $response = null ]) : Response
Parameters
- $response : Response|null = null
Return values
Response —A system response object
SaveDomainConfig()
public
SaveDomainConfig() : mixed
Return values
mixed —SearchOrphaned()
public
SearchOrphaned() : void
Return values
void —Setup()
Get/Set the widget context
public
Setup([Widget|null $setup = null ]) : Widget|null
Parameters
- $setup : Widget|null = null
Return values
Widget|null —update()
public
update() : void
Return values
void —updateContent()
public
updateContent() : void
Return values
void —UpdateOrphaned()
public
UpdateOrphaned() : mixed
Return values
mixed —updateSingleRelation()
update relation provides an interface to modify a single relation, this function is secured by access levels
public
updateSingleRelation() : mixed
Return values
mixed —ConfigGet()
Get a configuration by name
protected
ConfigGet(string $name) : void
Parameters
- $name : string
-
The name of the config file
Return values
void —ConfigGetPreset()
Get the configuration preset data
protected
ConfigGetPreset(string $name) : void
Parameters
- $name : string
-
The name of the config file
Return values
void —ConfigGetRaw()
Get configuration data as object from setup handler
protected
ConfigGetRaw(string $name) : Result
Parameters
- $name : string
-
The name of the config file
Return values
Result —ConfigSave()
Store a configuration with values from body and a given name
protected
ConfigSave(string $name) : void
Parameters
- $name : string
-
The name of the config file
Return values
void —CopyEntity()
copy a single content links the frontend to the copy handler for single contents identified by rest end point argument
protected
CopyEntity(array<string|int, mixed>|string $type, int|string $epIndex) : void
Parameters
- $type : array<string|int, mixed>|string
-
The requested content type
- $epIndex : int|string
-
Parse this parameter as id
Return values
void —CreateEntity()
create new object
protected
CreateEntity(string $type) : mixed
this method creates a new instance of a specific system content type
Parameters
- $type : string
-
A registered system content type
Return values
mixed —deleteEntity()
Delete a single content
protected
deleteEntity(string|array<string|int, string> $type, int|string $epIndex) : void
Implements the delete handler for single contents identified by rest end point argument
Parameters
- $type : string|array<string|int, string>
-
The requested content type
- $epIndex : int|string
-
Parse this parameter as id
Return values
void —fetchAssignedEntityList()
protected
fetchAssignedEntityList( $list[, null $language = null ]) : mixed
Parameters
Tags
Return values
mixed —fetchEntityList()
Fetch list of entries Use the direct loader method to retrieve a list obf objects
protected
fetchEntityList(string $type[, bool $raw = false ]) : void
Parameters
- $type : string
-
Fetch list of elements
- $raw : bool = false
-
Return as raw object and not plain
Return values
void —fetchEntityListFiltered()
Fetch filtered list
protected
fetchEntityListFiltered(string|array<string|int, string> $type[, array<string|int, mixed>|null $extra_payload = null ]) : void
Implements the server side data tables processing functions Supports free text search, paging and ordering at the moment
Parameters
- $type : string|array<string|int, string>
-
The requested content type(s)
- $extra_payload : array<string|int, mixed>|null = null
-
Additional filter operators
Return values
void —fetchObject()
Retrieve an object from storage
protected
fetchObject(int|string $id, string|array<string|int, string> $type[, string $right = 'view' ]) : BaseContent|bool|null
Load a single content from storage as instance If object was not found it will set the 404 error code
Parameters
- $id : int|string
-
A object id
- $type : string|array<string|int, string>
-
A object type
- $right : string = 'view'
-
An access level to test against
Return values
BaseContent|bool|null —A base content or null when not found or false when not access
handleSubViewList()
Handle the list/object loading for sub view of contents
protected
handleSubViewList(array<string|int, mixed> $payload) : mixed
Parameters
- $payload : array<string|int, mixed>
-
The request payload parent_type string Name of the parent type to manage inside parent string/int The id of the parent content attr string The attribute name to manage type string Type of the content to assign elements array List of elements when type is __multi content int Id when a direct content edit is performed (e.g. in child contents)
Tags
Return values
mixed —loadSingleEntity()
load a single content implements the loader for single contents identified by rest end point argument
protected
loadSingleEntity(string $type, int|string $epIndex[, string|null $language = null ]) : void
Parameters
- $type : string
-
The requested content type
- $epIndex : int|string
-
Parse this parameter as id
- $language : string|null = null
-
Language code to fetch element in
Return values
void —prepareObjectLogs()
Prepare the object comment and arguments for changes in diff
protected
prepareObjectLogs(BaseContent $item) : void
Parameters
- $item : BaseContent
Return values
void —UpdateEntity()
Update a single content
protected
UpdateEntity(string|array<string|int, string> $type, int|string $epIndex[, bool $return = false ]) : void
Implements the update handler for single contents identified by rest end point argument Does return the values when config option says so
Parameters
- $type : string|array<string|int, string>
-
The requested content type or, a list of allowed types
- $epIndex : int|string
-
Parse this parameter as id
- $return : bool = false
Return values
void —employeeOwnsContent()
private
employeeOwnsContent(string $id, string $type) : bool
Parameters
- $id : string
- $type : string
Return values
bool —employeeRootFolders()
private
employeeRootFolders([string $language = FAA_DEFAULT_LANGUAGE ]) : array<string|int, Folder>
Parameters
- $language : string = FAA_DEFAULT_LANGUAGE
Return values
array<string|int, Folder> —exportAsset()
Download the asset main file or,resolve the object
private
exportAsset(array<string|int, mixed> &$reference, string $path) : mixed
Parameters
- $reference : array<string|int, mixed>
- $path : string
Return values
mixed —exportTreeRecursive()
Helper to export a folder tree with full structure
private
exportTreeRecursive(array<string|int, mixed> &$structure, FolderTree &$folder, string $path, mixed $replace) : mixed
Parameters
- $structure : array<string|int, mixed>
- $folder : FolderTree
- $path : string
- $replace : mixed
Return values
mixed —folderObject()
private
folderObject(string $path) : mixed
Parameters
- $path : string
Return values
mixed —getRawObject()
Fetch a raw content
private
getRawObject(int|string $id, string $type[, string $error_field = '' ]) : Asset|BaseContent|null
Parameters
- $id : int|string
-
The content id
- $type : string
-
The content type
- $error_field : string = ''
-
When defined, set the error into a field
Return values
Asset|BaseContent|null —A base content object or an asset
moveOrCopySingleRelation()
Copy or, move a relation with its content
private
moveOrCopySingleRelation(string $action) : mixed
Parameters
- $action : string
-
Copy or move
Return values
mixed —openOrphaned()
Open a dedicated content that is orphaned
private
openOrphaned() : BaseContent|null