remi-san / doctrine-tools
A set of tools for Doctrine
Installs: 3 375
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- doctrine/orm: ^2.5
- psr/log: ^1.0
Requires (Dev)
- fabpot/php-cs-fixer: ^1.10
- mockery/mockery: ^0.9
- phpunit/phpunit: ^4.5
- squizlabs/php_codesniffer: ~2.0
This package is auto-updated.
Last update: 2024-10-21 22:50:15 UTC
README
Providing easy-to-use tools for doctrine.
Content
This lib provides the following util classes:
EntityManagerBuilder
an entity manager builder providing an easy way to add Doctrine types to theEntityManager
, you can also call methods on the type using a callable formatted array. It has been designed to be compatible with Symfony DI config files.Psr3SqlLogger
is a Doctrine logger encapsulating a PSR3 logger.
Usage example
EntityManagerBuilder
$builder = new EntityManagerBuilder($connection, $config); $builder->addType('customName', CustomType::class, [ [ 'callTypeMethod', []] ]); $entityManager = $builder->buildEntityManager();
Psr3SqlLogger
$logger = new Psr3SqlLogger($psr3Logger, LogLevel::INFO);