|
@@ 282-302 (lines=21) @@
|
| 279 |
|
* @throws Exception\DoctrineRuntimeException |
| 280 |
|
* @throws Exception\InvalidArgumentException |
| 281 |
|
*/ |
| 282 |
|
public function findCurrentSteps($entryId) |
| 283 |
|
{ |
| 284 |
|
$em = $this->getEntityManager(); |
| 285 |
|
|
| 286 |
|
$entryClassName = $this->getEntityClassName('entry'); |
| 287 |
|
|
| 288 |
|
/** @var EntryInterface $entry */ |
| 289 |
|
$entry = $em->getRepository($entryClassName)->find($entryId); |
| 290 |
|
|
| 291 |
|
$stepClassName = $this->getEntityClassName('step'); |
| 292 |
|
/** @var StepRepository $stepRepo */ |
| 293 |
|
$stepRepo = $em->getRepository($stepClassName); |
| 294 |
|
|
| 295 |
|
$currentSteps = $stepRepo->findCurrentSteps($entry); |
| 296 |
|
$result = new SplObjectStorage(); |
| 297 |
|
foreach ($currentSteps as $currentStep) { |
| 298 |
|
$result->attach($currentStep); |
| 299 |
|
} |
| 300 |
|
|
| 301 |
|
return $result; |
| 302 |
|
} |
| 303 |
|
|
| 304 |
|
|
| 305 |
|
/** |
|
@@ 384-404 (lines=21) @@
|
| 381 |
|
* @throws \OldTown\Workflow\Spi\Doctrine\Exception\DoctrineRuntimeException |
| 382 |
|
* @throws Exception\InvalidArgumentException |
| 383 |
|
*/ |
| 384 |
|
public function findHistorySteps($entryId) |
| 385 |
|
{ |
| 386 |
|
$em = $this->getEntityManager(); |
| 387 |
|
|
| 388 |
|
$entryClassName = $this->getEntityClassName('entry'); |
| 389 |
|
|
| 390 |
|
/** @var EntryInterface $entry */ |
| 391 |
|
$entry = $em->getRepository($entryClassName)->find($entryId); |
| 392 |
|
|
| 393 |
|
$stepClassName = $this->getEntityClassName('step'); |
| 394 |
|
/** @var StepRepository $stepRepo */ |
| 395 |
|
$stepRepo = $em->getRepository($stepClassName); |
| 396 |
|
|
| 397 |
|
$historySteps = $stepRepo->findHistorySteps($entry); |
| 398 |
|
$result = new SplObjectStorage(); |
| 399 |
|
foreach ($historySteps as $currentStep) { |
| 400 |
|
$result->attach($currentStep); |
| 401 |
|
} |
| 402 |
|
|
| 403 |
|
return $result; |
| 404 |
|
} |
| 405 |
|
|
| 406 |
|
/** |
| 407 |
|
* @todo Реализовать функционал |