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

AuditReader   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 6
lcom 1
cbo 1
dl 0
loc 51
rs 10
c 1
b 0
f 1

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A find() 0 4 1
A findRevisionHistory() 0 4 1
A findRevision() 0 4 1
A findRevisions() 0 4 1
A diff() 0 3 1
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