Documentation

TagCrudApiHandler
in package

Paginated listing and mutation for term and text tags.

Tags
since
3.4.0

Table of Contents

Methods

create()  : array{success: bool, id?: int, error?: string}
Create a tag.
delete()  : array{success: bool, deleted: int, error?: string}
Delete one tag.
deleteMany()  : array{success: bool, deleted: int, error?: string}
Delete several tags, or every tag matching a filter.
get()  : array<string, mixed>
Read one tag.
list()  : array<string, mixed>
List tags of one type, paginated and filtered.
update()  : array{success: bool, error?: string}
Update a tag.
facadeFor()  : TagsFacade|null
Resolve the facade for a tag type.

Methods

create()

Create a tag.

public create(string $type, array<string, mixed> $data) : array{success: bool, id?: int, error?: string}
Parameters
$type : string

Either term or text

$data : array<string, mixed>

Payload carrying text and comment

Return values
array{success: bool, id?: int, error?: string}

delete()

Delete one tag.

public delete(string $type, int $id) : array{success: bool, deleted: int, error?: string}
Parameters
$type : string

Either term or text

$id : int

Tag ID

Return values
array{success: bool, deleted: int, error?: string}

deleteMany()

Delete several tags, or every tag matching a filter.

public deleteMany(string $type, array<string, mixed> $data) : array{success: bool, deleted: int, error?: string}

all deletes everything the current filter selects, which is what the list page's "delete all" action does; without it only ids are removed.

Parameters
$type : string

Either term or text

$data : array<string, mixed>

Payload carrying ids, or all + query

Return values
array{success: bool, deleted: int, error?: string}

get()

Read one tag.

public get(string $type, int $id) : array<string, mixed>
Parameters
$type : string

Either term or text

$id : int

Tag ID

Return values
array<string, mixed>

The tag, or an error

list()

List tags of one type, paginated and filtered.

public list(string $type, array<string, mixed> $params) : array<string, mixed>
Parameters
$type : string

Either term or text

$params : array<string, mixed>

Query parameters

Return values
array<string, mixed>

Tags, pagination and the sort options

update()

Update a tag.

public update(string $type, int $id, array<string, mixed> $data) : array{success: bool, error?: string}
Parameters
$type : string

Either term or text

$id : int

Tag ID

$data : array<string, mixed>

Payload carrying text and comment

Return values
array{success: bool, error?: string}

facadeFor()

Resolve the facade for a tag type.

private facadeFor(string $type) : TagsFacade|null
Parameters
$type : string

Either term or text

Return values
TagsFacade|null

Facade, or null when the type is unknown

On this page

Search results