| @@ 307-317 (lines=11) @@ | ||
| 304 | /** |
|
| 305 | * @return Job[] |
|
| 306 | */ |
|
| 307 | public function findIncomingDependencies(Job $job) |
|
| 308 | { |
|
| 309 | $jobIds = $this->getJobIdsOfIncomingDependencies($job); |
|
| 310 | if (empty($jobIds)) { |
|
| 311 | return array(); |
|
| 312 | } |
|
| 313 | ||
| 314 | return $this->getJobManager()->createQuery("SELECT j, d FROM JMSJobQueueBundle:Job j LEFT JOIN j.dependencies d WHERE j.id IN (:ids)") |
|
| 315 | ->setParameter('ids', $jobIds) |
|
| 316 | ->getResult(); |
|
| 317 | } |
|
| 318 | ||
| 319 | /** |
|
| 320 | * @return Job[] |
|
| @@ 322-332 (lines=11) @@ | ||
| 319 | /** |
|
| 320 | * @return Job[] |
|
| 321 | */ |
|
| 322 | public function getIncomingDependencies(Job $job) |
|
| 323 | { |
|
| 324 | $jobIds = $this->getJobIdsOfIncomingDependencies($job); |
|
| 325 | if (empty($jobIds)) { |
|
| 326 | return array(); |
|
| 327 | } |
|
| 328 | ||
| 329 | return $this->getJobManager()->createQuery("SELECT j FROM JMSJobQueueBundle:Job j WHERE j.id IN (:ids)") |
|
| 330 | ->setParameter('ids', $jobIds) |
|
| 331 | ->getResult(); |
|
| 332 | } |
|
| 333 | ||
| 334 | private function getJobIdsOfIncomingDependencies(Job $job) |
|
| 335 | { |
|