Resource::getName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 1
cts 1
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
/**
4
 * This file is part of Webcook security bundle.
5
 *
6
 * See LICENSE file in the root of the bundle. Webcook
7
 */
8
9
namespace Webcook\Cms\SecurityBundle\Entity;
10
11
use Webcook\Cms\CoreBundle\Base\BasicEntity;
12
use Doctrine\ORM\Mapping as ORM;
13
use ApiPlatform\Core\Annotation\ApiResource;
14
use Symfony\Component\Validator\Constraints as Assert;
15
16
/**
17
 * System resource entity.
18
 *
19
 * @ApiResource(
20
 *  collectionOperations={
21
 *      "get"={"method"="GET"}
22
 *  },
23
 *  itemOperations={
24
 *      "get"={"method"="GET"},
25
 *      "delete"={"method"="DELETE"}
26
 *})
27
 * @ORM\Table(name="SecurityResource")
28
 * @ORM\Entity()
29
 */
30
class Resource extends BasicEntity
31
{
32
    /**
33
     * Resource name.
34
     *
35
     * @var string
36 30
     *
37
     * @ORM\Column(name="name", type="string", length=64, unique=true)
38 30
     */
39
    private $name;
40
41
    /**
42
     * Gets the value of name.
43
     *
44
     * @return mixed
45
     */
46
    public function getName()
47
    {
48 49
        return $this->name;
49
    }
50 49
51
    /**
52 49
     * Sets the value of name.
53
     *
54
     * @param mixed $name the name
55
     *
56
     * @return self
57
     */
58
    public function setName($name)
59
    {
60
        $this->name = $name;
61
62
        return $this;
63
    }
64
}
65