for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Dtc\QueueBundle\ORM;
use Doctrine\ORM\EntityManager;
use Dtc\GridBundle\Grid\Source\EntityGridSource;
class LiveJobGridSource extends EntityGridSource
{
protected $jobManager;
public function getId()
return 'dtc_queue.grid_source.live_jobs.orm';
}
public function __construct(JobManager $jobManager)
$this->jobManager = $jobManager;
/** @var EntityManager $entityManager */
$entityManager = $jobManager->getObjectManager();
parent::__construct($entityManager, $jobManager->getObjectName());
public function getColumns()
if ($columns = parent::getColumns()) {
return $columns;
$this->autoDiscoverColumns();
return parent::getColumns();
protected function getQueryBuilder()
$queryBuilder = $this->jobManager->getJobQueryBuilder();
$queryBuilder->setFirstResult($this->offset)
->setMaxResults($this->limit);
return $queryBuilder;
public function getCount()
$qb = $this->getQueryBuilder();
$qb->add('select', 'count(j)')
'count(j)'
string
object<Doctrine\ORM\Query\Expr\Base>
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example:
function acceptsInteger($int) { } $x = '123'; // string "123" // Instead of acceptsInteger($x); // we recommend to use acceptsInteger((integer) $x);
->setFirstResult(null)
->setMaxResults(null);
return $qb->getQuery()
->getSingleScalarResult();
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: