Completed
Push — 2.x ( 359f6e )
by Sullivan
16:25 queued 14:10
created

AuditReader::findRevisionHistory()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 3
1
<?php
2
3
/*
4
 * This file is part of the Sonata package.
5
 *
6
 * (c) Thomas Rabaix <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Sonata\DoctrineORMAdminBundle\Model;
13
14
use Sonata\AdminBundle\Model\AuditReaderInterface;
15
use SimpleThings\EntityAudit\AuditReader as SimpleThingsAuditReader;
16
17
class AuditReader implements AuditReaderInterface
18
{
19
    protected $auditReader;
20
21
    /**
22
     * @param \SimpleThings\EntityAudit\AuditReader $auditReader
23
     */
24
    public function __construct(SimpleThingsAuditReader $auditReader)
25
    {
26
        $this->auditReader = $auditReader;
27
    }
28
29
    /**
30
     * {@inheritdoc}
31
     */
32
    public function find($className, $id, $revision)
33
    {
34
        return $this->auditReader->find($className, $id, $revision);
35
    }
36
37
    /**
38
     * {@inheritdoc}
39
     */
40
    public function findRevisionHistory($className, $limit = 20, $offset = 0)
41
    {
42
        return $this->auditReader->findRevisionHistory($limit, $offset);
43
    }
44
45
    /**
46
     * {@inheritdoc}
47
     */
48
    public function findRevision($classname, $revision)
49
    {
50
        return $this->auditReader->findRevision($revision);
51
    }
52
53
    /**
54
     * {@inheritdoc}
55
     */
56
    public function findRevisions($className, $id)
57
    {
58
        return $this->auditReader->findRevisions($className, $id);
59
    }
60
61
    /**
62
     * {@inheritdoc}
63
     */
64
    public function diff($className, $id, $oldRevision, $newRevision){
65
        return $this->auditReader->diff($className, $id, $oldRevision, $newRevision);
66
    }
67
}
68