Skip to content

Commit 165fc2b

Browse files
author
Maarten Sprakel
committed
json_array -> json type
1 parent e302f2e commit 165fc2b

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Entity/Job.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class Job
122122
/** @ORM\Column(type = "string") */
123123
private $command;
124124

125-
/** @ORM\Column(type = "json_array") */
125+
/** @ORM\Column(type = "json") */
126126
private $args;
127127

128128
/**

Entity/Repository/JobManager.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
use Doctrine\Common\Util\ClassUtils;
2323
use Doctrine\DBAL\Connection;
2424
use Doctrine\DBAL\Types\Type;
25+
use Doctrine\DBAL\Types\Types;
2526
use Doctrine\ORM\EntityManager;
2627
use Doctrine\ORM\Query\Parameter;
2728
use Doctrine\ORM\Query\ResultSetMappingBuilder;
@@ -49,7 +50,7 @@ public function findJob($command, array $args = array())
4950
{
5051
return $this->getJobManager()->createQuery("SELECT j FROM JMSJobQueueBundle:Job j WHERE j.command = :command AND j.args = :args")
5152
->setParameter('command', $command)
52-
->setParameter('args', $args, Type::JSON_ARRAY)
53+
->setParameter('args', $args, Types::JSON)
5354
->setMaxResults(1)
5455
->getOneOrNullResult();
5556
}
@@ -75,7 +76,7 @@ public function getOrCreateIfNotExists($command, array $args = array())
7576

7677
$firstJob = $this->getJobManager()->createQuery("SELECT j FROM JMSJobQueueBundle:Job j WHERE j.command = :command AND j.args = :args ORDER BY j.id ASC")
7778
->setParameter('command', $command)
78-
->setParameter('args', $args, 'json_array')
79+
->setParameter('args', $args, 'json')
7980
->setMaxResults(1)
8081
->getSingleResult();
8182

@@ -132,7 +133,7 @@ private function acquireLock($workerName, Job $job)
132133

133134
public function findAllForRelatedEntity($relatedEntity)
134135
{
135-
list($relClass, $relId) = $this->getRelatedEntityIdentifier($relatedEntity);
136+
[$relClass, $relId] = $this->getRelatedEntityIdentifier($relatedEntity);
136137

137138
$rsm = new ResultSetMappingBuilder($this->getJobManager());
138139
$rsm->addRootEntityFromClassMetadata('JMSJobQueueBundle:Job', 'j');
@@ -150,7 +151,7 @@ public function findOpenJobForRelatedEntity($command, $relatedEntity)
150151

151152
public function findJobForRelatedEntity($command, $relatedEntity, array $states = array())
152153
{
153-
list($relClass, $relId) = $this->getRelatedEntityIdentifier($relatedEntity);
154+
[$relClass, $relId] = $this->getRelatedEntityIdentifier($relatedEntity);
154155

155156
$rsm = new ResultSetMappingBuilder($this->getJobManager());
156157
$rsm->addRootEntityFromClassMetadata('JMSJobQueueBundle:Job', 'j');

0 commit comments

Comments
 (0)