for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the Doctrine MongoDBBundle
*
* The code was originally distributed inside the Symfony framework.
* (c) Fabien Potencier <[email protected]>
* (c) Doctrine Project
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace As3\Bundle\ModlrBundle\DataCollector\MongoDb;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\DataCollector\DataCollector;
/**
* Data collector for the Doctrine MongoDB ODM.
* @author Kris Wallsmith <[email protected]>
class StandardDataCollector extends DataCollector
{
protected $queries;
public function __construct()
$this->queries = array();
}
public function logQuery(array $query)
$this->queries[] = $query;
public function collect(Request $request, Response $response, \Exception $exception = null)
$this->data['nb_queries'] = count($this->queries);
$this->data['queries'] = array_map('json_encode', $this->queries);
public function getQueryCount()
return $this->data['nb_queries'];
public function getQueries()
return $this->data['queries'];
public function getName()
return 'as3persistermongodb';