Failed Conditions
Push — master ( 6c283c...af5c96 )
by Adrien
05:50
created

BookableMetadata::setBookable()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Application\Model;
6
7
use Application\Traits\HasName;
8
use Doctrine\ORM\Mapping as ORM;
9
10
/**
11
 * An item that can be booked by a user
12
 *
13
 * @ORM\Entity(repositoryClass="Application\Repository\BookableMetadataRepository")
14
 * @ORM\Table(uniqueConstraints={
15
 *     @ORM\UniqueConstraint(name="unique_name", columns={"name", "bookable_id"})
16
 * })
17
 */
18
class BookableMetadata extends AbstractModel
19
{
20
    use HasName;
21
22
    /**
23
     * @var string
24
     *
25
     * @ORM\Column(type="string", length=191, options={"default" = ""})
26
     */
27
    private $value = '';
28
29
    /**
30
     * @var Bookable
31
     * @ORM\ManyToOne(targetEntity="Bookable")
32
     * @ORM\JoinColumns({
33
     *     @ORM\JoinColumn(onDelete="CASCADE")
34
     * })
35
     */
36
    private $bookable;
37
38
    /**
39
     * @return string
40
     */
41
    public function getValue(): string
42
    {
43
        return $this->value;
44
    }
45
46
    /**
47
     * @param string $value
48
     */
49
    public function setValue(string $value): void
50
    {
51
        $this->value = $value;
52
    }
53
54
    /**
55
     * @return Bookable
56
     */
57
    public function getBookable(): Bookable
58
    {
59
        return $this->bookable;
60
    }
61
62
    /**
63
     * @param Bookable $bookable
64
     */
65
    public function setBookable(Bookable $bookable): void
66
    {
67
        $this->bookable = $bookable;
68
    }
69
}
70