Completed
Pull Request — develop (#277)
by
unknown
13:23 queued 04:50
created

NotFoundException::getId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 * @filesource
4
 * @copyright (c) 2013 - 2016 Cross Solution (http://cross-solution.de)
5
 * @license MIT
6
 * @author Miroslav Fedeleš <[email protected]>
7
 * @since 0.27
8
 */
9
namespace Core\Entity\Exception;
10
11
/**
12
 * Exception indicating not found entity
13
 */
14
class NotFoundException extends \RuntimeException implements ExceptionInterface
15
{
16
17
    /**
18
     * @var string
19
     */
20
    protected $id;
21
22
    /**
23
     * @param string $id
24
     */
25
    public function __construct($id)
26
    {
27
        parent::__construct(sprintf('Entity with id "%s" not found', $id));
28
        
29
        $this->id = $id;
30
    }
31
32
    /**
33
     * @return string
34
     */
35
    public function getId()
36
    {
37
        return $this->id;
38
    }
39
}