Completed
Pull Request — 5.1 (#84)
by Maxim
08:05
created

EntityNotFoundException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 4
Bugs 2 Features 0
Metric Value
wmc 2
c 4
b 2
f 0
lcom 0
cbo 0
dl 0
loc 34
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setEntity() 0 8 1
A getEntity() 0 4 1
1
<?php
2
3
namespace Analogue\ORM\Exceptions;
4
5
use RuntimeException;
6
7
class EntityNotFoundException extends RuntimeException
8
{
9
    /**
10
     * Name of the affected Entity Map.
11
     *
12
     * @var string
13
     */
14
    protected $entity;
15
16
    /**
17
     * Set the affected Entity Map.
18
     *
19
     * @param  string   $entity
20
     * @return $this
21
     */
22
    public function setEntity($entity)
23
    {
24
        $this->entity = $entity;
25
26
        $this->message = "No query results for entity [{$entity}].";
27
28
        return $this;
29
    }
30
31
    /**
32
     * Get the affected Entity.
33
     *
34
     * @return string
35
     */
36
    public function getEntity()
37
    {
38
        return $this->entity;
39
    }
40
}
41