Installation
tilttek/points-bundleRequirements
- PHP 8.5 or later, Symfony 8.2 (Config and DependencyInjection), Doctrine DBAL 4.5.
tilttek/pointsandphil/resource, required.- A
clockservice, which FrameworkBundle registers. tilttek/activity-bundle, for the earning rules: it keeps the journal of activity and catches up the projection.- Optional:
doctrine/ormand DoctrineBundle for the tables in the migrations,symfony/consolefor the commands,phil/privacy-bundlefor the export and the erasure of a member.
Enabling the bundle
// config/bundles.php
return [
// ...
Tilttek\ActivityBundle\TilttekActivityBundle::class => ['all' => true],
Tilttek\PointsBundle\TilttekPointsBundle::class => ['all' => true],
];
With no configuration, the ledger is kept on the default DBAL connection in one currency, points, that never
expires, and no rule earns anything: points move only by what the application decides.
The migration
When the ORM is installed, the bundle adds its two tables to the schema the ORM generates for the ledger's connection:
bin/console doctrine:migrations:diff
bin/console doctrine:migrations:migrate
Without the ORM, create the tables from PointsTables::configure() in the application's own migration tool:
foreach ($platform->getCreateTablesSQL(PointsTables::configure(new Schema())->getTables()) as $sql) {
$connection->executeStatement($sql);
}