Completed
Push — master ( 334f6b...01d482 )
by Adrien
11:34
created

Bookable::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
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\DBAL\Types\BookingTypeType;
8
use Application\Traits\HasCode;
9
use Application\Traits\HasDescription;
10
use Application\Traits\HasName;
11
use Doctrine\Common\Collections\ArrayCollection;
12
use Doctrine\Common\Collections\Collection;
13
use Doctrine\ORM\Mapping as ORM;
14
15
/**
16
 * An item that can be booked by a user
17
 *
18
 * @ORM\Entity(repositoryClass="Application\Repository\BookableRepository")
19
 */
20
class Bookable extends AbstractModel
21
{
22
    use HasName;
23
    use HasDescription;
24
    use HasCode;
25
26
    /**
27
     * @var string
28
     *
29
     * @ORM\Column(type="decimal", length=10, options={"default" = "0"})
30
     */
31
    private $initialPrice = '0.00';
0 ignored issues
show
introduced by
The private property $initialPrice is not used, and could be removed.
Loading history...
32
33
    /**
34
     * @var string
35
     *
36
     * @ORM\Column(type="decimal", length=10, options={"default" = "0"})
37
     */
38
    private $periodicPrice = '0.00';
0 ignored issues
show
introduced by
The private property $periodicPrice is not used, and could be removed.
Loading history...
39
40
    /**
41
     * @var int
42
     *
43
     * @ORM\Column(type="smallint", options={"unsigned" = true, "default" = "1"})
44
     */
45
    private $simultaneousBookingMaximum = 1;
0 ignored issues
show
introduced by
The private property $simultaneousBookingMaximum is not used, and could be removed.
Loading history...
46
47
    /**
48
     * @var string
49
     *
50
     * @ORM\Column(type="BookingType", length=10, options={"default" = BookingTypeType::SELF_APPROVED})
51
     */
52
    private $bookingType = BookingTypeType::SELF_APPROVED;
0 ignored issues
show
introduced by
The private property $bookingType is not used, and could be removed.
Loading history...
53
54
    /**
55
     * @var Collection
56
     * @ORM\ManyToMany(targetEntity="Application\Model\Booking", mappedBy="bookables")
57
     */
58
    private $bookings;
59
60
    /**
61
     * @var Collection
62
     * @ORM\ManyToMany(targetEntity="License", mappedBy="bookables")
63
     */
64
    private $tags;
65
66
    /**
67
     * Constructor
68
     */
69
    public function __construct()
70
    {
71
        $this->bookings = new ArrayCollection();
72
        $this->tags = new ArrayCollection();
73
    }
74
75
    /**
76
     * @return Collection
77
     */
78
    public function getBookings(): Collection
79
    {
80
        return $this->bookings;
81
    }
82
83
    /**
84
     * @return Collection
85
     */
86
    public function getTags(): Collection
87
    {
88
        return $this->tags;
89
    }
90
}
91