Skip to content

TagRepository #112

@derpixler

Description

@derpixler

API Reference: Tags

The most complex repository. extends AbstractRepository, getListKey() → 'tags'.

all() overrides the base implementation — requires object and o_id query parameters, defaults to object=Ticket&o_id=1. search() delegates to tagSearch() — the endpoint tag_search?term= is the only search mechanism.

add(string $objectType, int $objectId, string $tag) POSTs to tags/add with the object type, ID, and tag item. remove(string $objectType, int $objectId, string $tag) builds the endpoint URL with query parameters and sends DELETE: tags/remove?object=Ticket&o_id=1&item=tag. tagSearch(string $term) returns raw results from GET tag_search?term=.

find(int $id) is inherited from AbstractRepository but tags use a composite key (object + ID) — numeric lookup alone is not meaningful.

Depends on:

Produces: TagRepository

Acceptance Criteria

  • Testing: TagRepositoryTest — add(Ticket,1,test), remove, tagSearch, all with object+o_id params
  • Documentation in README: README — tag add/remove example

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No fields configured for Task.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions