elcodi/fixtures-booster-bundle
Fixtures Booster Bundle is part of Elcodi, an e-commerce suite of Symfony components and bundles under the MIT license. It helps seed and boost fixture data for Elcodi applications. This read-only package directs issues and pull requests to the main elcodi/elcodi repository.
This bundle is the fixture layer of Elcodi's e-commerce stack: it seeds your database with the entity graph Elcodi expects (currencies, languages, tax zones, categories, products, variants, customers when applicable) so you can boot a working storefront instead of hand-writing dozens of Doctrine fixtures.
Minimal steps (Symfony 2.x/3.x era, matching the 2016 EOL):
Install — pin explicitly, since the package is archived and the read-only mirror on this repo will never receive fixes:
composer require elcodi/fixtures-booster-bundle:^1.0 --dev
Prefer the stable tag over dev-master; there is no maintainer to unbreak a master-tracking install.
Register in app/AppKernel.php (dev/test only):
if (in_array($this->getEnvironment(), ['dev', 'test'])) {
$bundles[] = new Elcodi\Bundle\FixturesBoosterBundle\ElcodiFixturesBoosterBundle();
}
Load the fixture set:
php app/console doctrine:fixtures:load --no-interaction
On Elcodi-based apps the Doctrine fixtures bundle plus this booster is normally all you need; no extra config is required beyond the Elcodi core bundles.
Where to look first: the bundle's Resources/config/ for the service definitions that register each fixture, and its DataFixtures/ORM/ directory for the concrete classes. Because this repo is read-only, treat github.com/elcodi/elcodi as the real source of truth for issues, docs, and the matching Bundle versions — the README explicitly redirects there.
First use case: a fresh dev database with a browsable catalog. Load fixtures, then point your storefront at the seeded category/product IDs and verify a cart flow end-to-end before you write a single line of your own domain code.
Extend, don't edit. Each booster fixture is a normal Doctrine\Common\DataFixtures\FixtureInterface. Subclass the ones you need and override the data-producing method rather than copying:
namespace Acme\AppBundle\DataFixtures\ORM;
use Elcodi\Bundle\FixturesBoosterBundle\DataFixtures\ORM\ProductFixture as BaseFixture;
class ProductFixture extends BaseFixture
{
protected function getProductData()
{
return array_merge(parent::getProductData(), [
['name' => 'Acme T-Shirt', 'sku' => 'ACME-001', 'price' => 1999],
]);
}
}
Register your override as a service with the same ID as the original to replace it via the container, or simply omit the base class from your loader and use yours.
Mind the ordering. Elcodi's entity graph is deeply dependent (Currency → Language → Tax → Category → Product → Variant). Use DependentFixtureInterface or the fixtures loader's ordering to guarantee parents exist before children. If the booster already declares dependencies, keep them intact in subclasses.
Use groups for environment separation. Tag fixtures and load subsets:
php app/console doctrine:fixtures:load --group=base # currencies, languages, tax
php app/console doctrine:fixtures:load --group=dev --append # catalog sample data
The --append flag matters in dev: without it, every load purges the schema and you lose any manually created test accounts.
Reference-based composition. Booster fixtures typically call $this->addReference('elcodi.category.root', $category). In your own fixtures, resolve them with $this->getReference(...) instead of re-querying the repository — it survives flushes and avoids ID drift between fixture runs.
Test harness integration. For functional tests, load only the minimal groups in setUp inside a transaction, and roll back. This is dramatically faster than a full load and keeps tests isolated:
protected function setUp()
{
$this->fixtures = ['base'];
$this->loadFixtures(); // wraps doctrine:fixtures:load in a transaction
}
Custom data via config. Where the booster exposes parameters (locales, currency codes), set them in parameters.yml rather than forking the fixture — it keeps upgrades (such as they are) and diffing painless.
dev-master here with tagged Elcodi packages is the most common source of "class not found" and service-not-registered errors. Pin everything from the same release.doctrine:fixtures:load purges. On databases with FKs across many tables, purge can fail — try --purge-with-truncate. In dev workflows, default to --append.memory_limit for the CLI or override fixtures to flush in batches ($em->flush(); $em->clear();). Clearing detaches managed entities — your getReference calls still work, but object identity checks in custom fixture code won't.base group ran first.AppKernel for the override to stick. Confirm with php app/console debug:container <service.id>.-vvv; when a fixture fails silently, check whether the fixture is registered at all (debug:container --tag=doctrine.fixtures) before suspecting data.require-dev. Shipping e-commerce sample data (products, categories, prices) to production is both a data-integrity and an SEO liability.How can I help you explore Laravel packages today?