DiscordPHP-MTG Documentation

Repository

Table of Contents

Classes

AbstractRepository
Base class for the MTG read-only repositories: DiscordPHP's {@see DiscordAbstractRepository} behaviour (keyed, cached collection of Parts) backed by MTGJSON — the {@see \MTG\Http\Http} client for the small API files, and the local {@see Database} build for cards and sets.
CardRepository
Card printings from MTGJSON's AllPrintings build — search with any {@see CardQuery} filter, and fetch one by its MTGJSON `uuid` — hydrating {@see Card} parts with their identifiers, legalities, rulings, foreign data and purchase URLs.
DeckRepository
Preconstructed decks from the MTGJSON API: the deck list (`DeckList.json`) to search, and one deck with its cards (`decks/{fileName}.json`) to fetch, hydrating {@see Deck} parts.
SetRepository
Sets from MTGJSON's AllPrintings build — search them, fetch one by code, and open booster packs from their booster configurations — hydrating {@see Set} parts with their name translations.

Traits

AbstractRepositoryTrait
Shared implementation for every MTG repository: DiscordPHP's `AbstractRepositoryTrait` ported so the collection is keyed and cached the same way, but backed by {@see \MTG\Http\Http} and MTG {@see \MTG\Http\Endpoint}s. Consumed by {@see AbstractRepository}.
DatabaseRepositoryTrait
`fetch()`, `fresh()` and `freshen()` for repositories answered from the local MTGJSON build instead of an HTTP endpoint. MTGJSON serves cards and sets only inside whole files, so there is no per-item route to call.
On this page

Search results