Completed
Pull Request — master (#15)
by Wachter
15:35 queued 05:39
created

TaskRepository::findEndBeforeNow()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Task\TaskBundle\DoctrineStorage;
4
5
use Doctrine\Common\Persistence\ObjectManager;
6
use Task\Storage\TaskRepositoryInterface;
7
use Task\TaskBundle\Entity\TaskRepository as ORMTaskRepository;
8
use Task\TaskInterface;
9
10
class TaskRepository implements TaskRepositoryInterface
11
{
12
    /**
13
     * @var ObjectManager
14
     */
15
    private $objectManager;
16
17
    /**
18
     * @var ORMTaskRepository
19
     */
20
    private $taskRepository;
21
22
    /**
23
     * {@inheritdoc}
24
     */
25
    public function add(TaskInterface $task)
26
    {
27
        $this->objectManager->persist($task);
28
        $this->objectManager->flush();
29
    }
30
31
    /**
32
     * {@inheritdoc}
33
     */
34
    public function findAll()
35
    {
36
        return $this->taskRepository->findAll();
37
    }
38
39
    /**
40
     * {@inheritdoc}
41
     */
42
    public function findEndBeforeNow()
43
    {
44
        return $this->taskRepository->findEndBefore(new \DateTime());
45
    }
46
}
47