elcodi/product
Product component from the Elcodi e-commerce suite for Symfony, offering product modeling and management under the MIT license. Note that this package is read-only; use the main elcodi/elcodi repository for issues, questions, and pull requests.
Before writing any code, verify compatibility. This subtree split dates to mid-2015 and targets the Symfony 2.x / PHP 5.x era; it will not install cleanly on modern PHP or Symfony. Treat it as a maintenance-only dependency for existing Elcodi applications, not a greenfield choice.
If you are on a compatible stack, install with composer require elcodi/product. If you're using the full suite, require elcodi/elcodi (or the ProductBundle) instead — the bare component ships interfaces, entities, and factories but no DI wiring or Doctrine mapping.
Look first at: Entity/ (Product, Variant, ProductTranslation), Factory/, Repository/, and the event-constants class. That is effectively the entire API surface; the README contributes almost nothing.
First use case: construct a product through its factory, attach a translation, persist via the repository:
$product = $productFactory->create();
$product->setName('My product'); // or via translation
$productRepository->save($product);
The companion bundle is where services, mappings, and event subscribers live. Read its Resources/config/ before assuming behaviour in the component.
new Product() directly — always go through ProductFactoryInterface. Custom factories and listeners rely on that seam, and bypassing it silently skips them.ProductTranslation per locale (from elcodi/language) and attach it to the product. Don't set translatable fields through the base entity and expect locale-aware reads later.Variant; Product is the catalog-level record. Manage variants through the product's collection or a variant factory so events fire.App\Entity\Product extends Elcodi\...\Product, implement the matching interface, and override the bundle's class parameter + Doctrine mapping. Keep the interface contract so cart/order components resolve it.elcodi/elcodi. Any fix must be applied in the monorepo or as a fork/patch; nothing lands here.composer.lock.dev-master alias is explicitly unstable. Pin to the last stable tag and keep elcodi/core and elcodi/language in lockstep — mismatched transitive versions cause hard-to-trace mapping errors.debug:container to confirm which concrete class the factory produces, and the Symfony profiler for generated queries. A listener swallowing an exception is the usual cause of silent no-ops.ProductInterface, VariantInterface), factories, repositories, and the event dispatcher. Override services in app config rather than patching the package.How can I help you explore Laravel packages today?