1 | <?php |
||
11 | class TaskExecutionRepository implements TaskExecutionRepositoryInterface |
||
12 | { |
||
13 | /** |
||
14 | * @var ObjectManager |
||
15 | */ |
||
16 | private $objectManager; |
||
17 | |||
18 | /** |
||
19 | * @var ORMTaskExecutionRepository |
||
20 | */ |
||
21 | private $taskExecutionRepository; |
||
22 | |||
23 | /** |
||
24 | * @param ObjectManager $objectManager |
||
25 | * @param ORMTaskExecutionRepository $taskExecutionRepository |
||
26 | */ |
||
27 | public function __construct(ObjectManager $objectManager, ORMTaskExecutionRepository $taskExecutionRepository) |
||
32 | |||
33 | /** |
||
34 | * {@inheritdoc} |
||
35 | */ |
||
36 | public function store(TaskExecutionInterface $execution) |
||
37 | { |
||
38 | $this->objectManager->persist($execution); |
||
39 | |||
40 | // FIXME move this flush to somewhere else (: |
||
41 | $this->objectManager->flush(); |
||
42 | |||
43 | return $this; |
||
44 | } |
||
45 | |||
46 | /** |
||
47 | * {@inheritdoc} |
||
48 | */ |
||
49 | public function save(TaskExecutionInterface $execution) |
||
50 | { |
||
51 | $this->objectManager->persist($execution); |
||
52 | |||
53 | // FIXME move this flush to somewhere else (: |
||
54 | $this->objectManager->flush(); |
||
55 | |||
56 | return $this; |
||
57 | } |
||
58 | |||
59 | /** |
||
60 | * {@inheritdoc} |
||
61 | */ |
||
62 | public function findByStartTime(TaskInterface $task, \DateTime $scheduleTime) |
||
66 | |||
67 | /** |
||
68 | * {@inheritdoc} |
||
69 | */ |
||
70 | public function findAll($limit = null) |
||
74 | |||
75 | /** |
||
76 | * {@inheritdoc} |
||
77 | */ |
||
78 | public function findScheduled() |
||
82 | } |
||
83 |