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

EntityNotFoundException::getEnity()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 2 Features 0
Metric Value
c 3
b 2
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
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