$client->ticket() returns a TicketRepository via PHP's __call() magic method.
How it works: The method name (e.g. ticket) is CamelCased and matched against RepositoryRegistry::DEFINITIONS. Both the DTO short name and repository short name are tried. Underscores are supported (ticket_article → TicketArticleRepository). All 10 resources (Ticket, User, Organization, Group, TicketArticle, TicketState, TicketPriority, Tag, TextModule, Link) are accessible this way.
Memoization: Calling $client->ticket() twice returns the same instance — repositories are cached by FQCN in an internal array.
Error: Unknown resource names throw InvalidArgumentException with a descriptive message.
Internal API: repo(TicketRepository::class) remains available for edge cases where magic resolution is ambiguous or for programmatic access.
Acceptance Criteria
Depends on
Produces
ZammadClient (__call method)
$client->ticket()returns aTicketRepositoryvia PHP's__call()magic method.How it works: The method name (e.g.
ticket) is CamelCased and matched againstRepositoryRegistry::DEFINITIONS. Both the DTO short name and repository short name are tried. Underscores are supported (ticket_article→TicketArticleRepository). All 10 resources (Ticket, User, Organization, Group, TicketArticle, TicketState, TicketPriority, Tag, TextModule, Link) are accessible this way.Memoization: Calling
$client->ticket()twice returns the same instance — repositories are cached by FQCN in an internal array.Error: Unknown resource names throw
InvalidArgumentExceptionwith a descriptive message.Internal API:
repo(TicketRepository::class)remains available for edge cases where magic resolution is ambiguous or for programmatic access.Acceptance Criteria
Depends on
Produces
ZammadClient(__call method)