tilttek / collections-bundle
Collectibles for Symfony on tilttek/collections: the catalog in configuration or the database; copies, sets, packs, chosen dice and the item of the day in Doctrine DBAL; its activity projection; the inventory tilttek/exchange trades through; dice appearance for tilttek/dice-bundle; events, Twig temp
Package info
github.com/TiltTek/collections-bundle
Type:symfony-bundle
pkg:composer/tilttek/collections-bundle
Requires
- php: >=8.5
- doctrine/dbal: ^4.5
- phil/resource: ^0.1@dev
- psr/clock: ^1.0
- psr/event-dispatcher: ^1.0
- symfony/config: ^8.2
- symfony/dependency-injection: ^8.2
- tilttek/collections: ^0.1@dev
Requires (Dev)
- doctrine/doctrine-bundle: ^3.3
- doctrine/orm: ^3.7
- phpunit/phpunit: ^13.4
- symfony/clock: ^8.2
- symfony/console: ^8.2
- symfony/event-dispatcher: ^8.2
- symfony/framework-bundle: ^8.2
- symfony/http-kernel: ^8.2
- symfony/translation: ^8.2
- symfony/twig-bundle: ^8.2
- symfony/yaml: ^8.2
- tilttek/activity: ^0.1@dev
- tilttek/activity-bundle: ^0.1@dev
- tilttek/dice-bundle: ^0.1@dev
- tilttek/exchange: ^0.1@dev
- twig/twig: ^3.21
Suggests
- doctrine/orm: To add the collections' tables to the schema the ORM generates, and so to the migrations
- phil/almanac: For items of the day on computed dates, such as Easter or the fourth Thursday of November
- phil/privacy-bundle: To export and erase a member's collection with the rest of their account
- symfony/console: For the commands that generate the calendar, give a copy and show an album
- symfony/translation: To translate the templates' texts
- symfony/twig-bundle: For the Twig functions and the templates of the album, the item of the day and the odds of a pack
- tilttek/activity-bundle: To keep the journal of activity the item of the day is claimed on, and catch its projection up live or by a command
- tilttek/dice-bundle: To roll the dice of a set a member owns and chose, through the appearance this bundle provides
- tilttek/exchange-bundle: To let members trade the copies of their collections, through the inventory this bundle provides
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-11 14:51:22 UTC
README
Collectible items for Symfony: the catalog, the members' copies, the item of the day, packs and dice, in Doctrine DBAL.
tilttek/collections-bundle integrates tilttek/collections with Symfony. The catalog — rarities, items, sets, packs
— is configured, checked when the container is compiled, or kept in the database and edited one definition at a time.
The copies, the sets completed, the packs opened, the dice chosen and the calendar of the item of the day live in six
tables of a Doctrine DBAL connection, added to the schema the ORM generates so that the application's migrations
create them, each copy written once even when two processes give it. The item of the day is given on the members'
activity by a projection tilttek/activity-bundle keeps up to date, on fixed dates, on dates phil/almanac computes
and by a draw weighted by rarity on the free days. A copy given and a set completed — with its rewards — become events
of the application's dispatcher. The bundle provides the inventory tilttek/exchange trades through and the
appearance of a member's dice for tilttek/dice-bundle, Twig functions and templates for the album, the item of the
day and the odds of a pack, commands that generate the calendar, give a copy and show an album, and the export and
erasure of a member for phil/privacy-bundle.
It is for a Symfony application that gives its members something to collect. Its dependencies are
tilttek/collections, Doctrine DBAL, phil/resource, the PSR event dispatcher and Symfony's configuration and
dependency injection; every other integration is registered only when its package is installed.
The design follows the library: the stores implement its contracts on DBAL, CollectionsServices wires the services
from the configuration, and adapters under Infrastructure meet the other packages — Almanac, Exchange, Dice,
Event, Console, Twig, Privacy. The bundle has no model of its own.
Status
| Part | State |
|---|---|
TilttekCollectionsBundle, CollectionsServices: the configuration, checked when the container is compiled, and the services |
Implemented and tested |
CollectionsTables, CollectionsSchemaListener, Rows: the six tables in the generated schema, the idempotent insertion per platform |
Implemented and tested |
DbalCopyStore, DbalCompletionStore, DbalOpeningStore, DbalChoiceStore, DbalDailyStore: the library's stores on DBAL |
Implemented and tested |
DbalCatalog: the catalog in the database, edited one definition at a time |
Implemented and tested |
AlmanacDateRule: items of the day on the dates phil/almanac computes |
Implemented and tested |
CollectionsInventory: the copies as the inventory of tilttek/exchange |
Implemented and tested |
CollectionDiceAppearance: the chosen die as the appearance of tilttek/dice-bundle |
Implemented and tested |
DispatchingObserver, CopyGranted: the events |
Implemented and tested |
DailyCommand, GrantCommand, AlbumCommand: the commands |
Implemented and tested |
CollectionsExtension and the templates album, daily, odds, in English and French |
Implemented and tested |
CollectionsPrivacy: the export and erasure of a member |
Implemented and tested |
Documentation
| Document | What it covers |
|---|---|
| Installation | Requirements, registering the bundle, the migration. |
| Configuration | Every key, with its default. |
| The database | The six tables, the catalog in the database, concurrency. |
| The item of the day | The calendar, its dates, its draw, the projection and the command. |
| Extension points | Trades through tilttek/exchange, dice for tilttek/dice-bundle, seeds, the catalog. |
| Events | CopyGranted and SetCompleted. |
| Templates | The Twig functions and the three templates. |
| Commands | tilttek:collections:daily, tilttek:collections:grant, tilttek:collections:album. |
| Privacy | The module of phil/privacy-bundle. |
| Exceptions | What the bundle raises. |
| Testing | The bundle's tests, and testing an application that uses it. |
| Reference | Every class of the bundle, with its role. |
Quick start
composer require tilttek/collections-bundle tilttek/activity-bundle
# config/packages/tilttek_collections.yaml tilttek_collections: timezone: America/Toronto rarities: { common: 70, rare: 25, legendary: 5 } items: deckhand: { name: { en: Deckhand, fr: Matelot }, rarity: common, sets: [crew] } captain: { name: Captain, rarity: legendary, sets: [crew] } sets: crew: { name: The crew, rewards: [{ kind: points, code: xp, amount: 50 }] } daily: enabled: true verbs: ['page.viewed']
{{ include('@TilttekCollections/album.html.twig', {album: tilttek_collections_album('member:' ~ app.user.id), locale: app.request.locale}) }}
Requirements
PHP 8.5 or later, Symfony 8.2, Doctrine DBAL 4.5.
Contributing
Contributions are welcome on the PHIL monorepo: read the contribution guide and the code of conduct. Report a vulnerability privately, as the security policy explains, never in a public issue.
License
MIT, © Philippe Gamache, doing business as Le Gnome Archiviste; a Tilttek project. See LICENSE.