IsolateIdentifier   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A isEntity() 0 6 2
A isPersisted() 0 6 2
A getIdentity() 0 6 2
1
<?php
2
3
namespace Isolate\Framework\UnitOfWork\Entity;
4
5
use Isolate\LazyObjects\WrappedObject;
6
use Isolate\UnitOfWork\Entity\Identifier\EntityIdentifier;
7
8
class IsolateIdentifier extends EntityIdentifier
9
{
10
    /**
11
     * @param $object
12
     * @return bool
13
     */
14
    public function isEntity($object)
15
    {
16
        $targetObject = ($object instanceof WrappedObject) ? $object->getWrappedObject() : $object;
17
18
        return parent::isEntity($targetObject);
19
    }
20
21
    /**
22
     * @param mixed $entity
23
     * @return bool
24
     */
25
    public function isPersisted($entity)
26
    {
27
        $targetEntity = ($entity instanceof WrappedObject) ? $entity->getWrappedObject() : $entity;
28
29
        return parent::isPersisted($targetEntity);
30
    }
31
32
    /**
33
     * @param $entity
34
     * @return mixed
35
     */
36
    public function getIdentity($entity)
37
    {
38
        $targetEntity = ($entity instanceof WrappedObject) ? $entity->getWrappedObject() : $entity;
39
40
        return parent::getIdentity($targetEntity);
41
    }
42
}
43