Resource factories
Default factory for your resource
Inject the factory in your service
namespace App;
use Sylius\Resource\Factory\FactoryInterface;
final class MyService
{
public function __construct(
private FactoryInterface $bookFactory,
) {}
}Define your custom factory
Use your custom method
Pass arguments to your method
Use a factory without declaring it
Use a callable for your custom factory
Last updated
Was this helpful?
