-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How integrate Doctrine Queries? #6
Comments
Try http://phpdebugbar.com/docs/bridge-collectors.html#doctrine |
Create collector: use Interop\Container\ContainerInterface;
use DebugBar\Bridge\DoctrineCollector;
use Doctrine\DBAL\Logging\DebugStack;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
/**
* Factory of `DoctrineCollector`.
* @see DoctrineCollector
*/
class DoctrineCollectorFactory implements FactoryInterface
{
/**
* {@inheritdoc}
*/
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
{
$debugStack = new DebugStack;
$entityManager = $container->get('Doctrine\ORM\EntityManager');
$entityManager->getConnection()->getConfiguration()->setSQLLogger($debugStack);
$collector = new DoctrineCollector($debugStack);
return $collector;
}
/**
* {@inheritdoc}
*/
public function createService(ServiceLocatorInterface $serviceLocator)
{
return $this($serviceLocator, DoctrineCollector::class);
}
} Update config: use DebugBar\Bridge\DoctrineCollector;
use <NAMESPACE>\<TO>\DoctrineCollectorFactory;
return [
'php-debug-bar' => [
'collectors' => [
DoctrineCollector::class,
],
],
'service_manager' => [
'factories' => [
DoctrineCollector::class => DoctrineCollectorFactory::class,
],
],
]; |
@bupy7 great! Can you prepare merge request with this into module? |
@snapshotpl Yes, I can. ) |
Awesome. Can you start from #13 ? |
@snapshotpl Ok. |
Thanks @bupy7 thats awesome. :) |
snapshotpl
pushed a commit
that referenced
this issue
Oct 26, 2016
snapshotpl
pushed a commit
that referenced
this issue
Oct 27, 2016
@a-h-abid merged and released |
Awesome :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice thing, just not seeing Db Queries. Can you help how to see Queries through Doctrine? Using doctrine/doctrine-orm-module
The text was updated successfully, but these errors were encountered: