MemberFolderApi

Reference for the MemberFolderApi module: a member-scoped JSON API over MemberFolder for reactive frontends. Endpoints live at /api/MemberFolder/v1/* and are declared into the ApiConfig registry at load. The acting member is always taken from the session, never from the request body, so a client can only ever see and change its own folders.

This page is a pure reference. Reads and writes are POST endpoints that take a JSON body and return the ApiResult envelope; each handler receives the decoded request object and returns a plain response object.

Classes
  • MemberFolderApi - member-scoped JSON API over MemberFolder, at /api/MemberFolder/v1/*.

MemberFolderApi

Declares the MemberFolder v1 endpoints and holds the handler for each one. Every handler resolves the acting member from the session, so all reads and writes are scoped to that member's own folders.

Children

MemberFolderApi::Children(object $request): object

Handler for the children endpoint. Lists the acting member's folders under a given parent, each with its own child count.

NameTypeDescription
$requestobjectThe decoded request, with an optional parentId.

Returns object An object with the parentId and the list of child folders.

Create

MemberFolderApi::Create(object $request): object

Handler for the create endpoint. Creates a folder for the acting member under a given parent.

NameTypeDescription
$requestobjectThe decoded request, with moduleName, folderType, an optional parentId and a name.

Returns object An object with the created folder.

Delete

MemberFolderApi::Delete(object $request): object

Handler for the delete endpoint. Deletes one of the acting member's folders.

NameTypeDescription
$requestobjectThe decoded request, with the folderId to delete.

Returns object An object with the deleted folder id.

Endpoints

MemberFolderApi::Endpoints(): void

Declare the MemberFolder v1 endpoints into the ApiConfig registry. Registers the children, path, create, rename, move and delete POST endpoints, each guarded so the member must be logged in. Called once at module load.

Returns void

Move

MemberFolderApi::Move(object $request): object

Handler for the move endpoint. Moves one of the acting member's folders under a new parent.

NameTypeDescription
$requestobjectThe decoded request, with the folderId and an optional new parentId.

Returns object An object with the moved folder.

Path

MemberFolderApi::Path(object $request): object

Handler for the path endpoint. Returns the ancestor chain from the root down to a given folder, for the acting member.

NameTypeDescription
$requestobjectThe decoded request, with an optional folderId.

Returns object An object with the path of folders.

Rename

MemberFolderApi::Rename(object $request): object

Handler for the rename endpoint. Renames one of the acting member's folders.

NameTypeDescription
$requestobjectThe decoded request, with the folderId and the new name.

Returns object An object with the renamed folder.