| 1 | <?php |
||
| 13 | class RoomResource |
||
| 14 | { |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @ORM\Column(name="id", type="integer") |
||
| 18 | * @ORM\Id |
||
| 19 | * @ORM\GeneratedValue(strategy="AUTO") |
||
| 20 | * @var int |
||
| 21 | */ |
||
| 22 | private $id; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Комната в которой находится ресурс |
||
| 26 | * @ORM\ManyToOne(targetEntity="Room") |
||
| 27 | * @ORM\JoinColumn(name="room_id", referencedColumnName="id", nullable=false) |
||
| 28 | * @var Room |
||
| 29 | */ |
||
| 30 | private $room; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Предмет ресурса |
||
| 34 | * @ORM\ManyToOne(targetEntity="Rottenwood\KingdomBundle\Entity\Infrastructure\Item") |
||
| 35 | * @ORM\JoinColumn(name="item_id", referencedColumnName="id", nullable=false) |
||
| 36 | * @var Item |
||
| 37 | */ |
||
| 38 | private $item; |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Количество предметов |
||
| 42 | * @var int |
||
| 43 | * @ORM\Column(name="quantity", type="integer") |
||
| 44 | */ |
||
| 45 | private $quantity; |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @param Room $room |
||
| 49 | * @param Item $item |
||
| 50 | * @param int $quantity |
||
| 51 | */ |
||
| 52 | public function __construct(Room $room, Item $item, $quantity) |
||
| 58 | |||
| 59 | /** |
||
| 60 | * @return int |
||
| 61 | */ |
||
| 62 | public function getId() |
||
| 66 | |||
| 67 | /** |
||
| 68 | * @return Room |
||
| 69 | */ |
||
| 70 | public function getRoom() |
||
| 74 | |||
| 75 | /** |
||
| 76 | * @return Item |
||
| 77 | */ |
||
| 78 | public function getItem() |
||
| 82 | |||
| 83 | /** |
||
| 84 | * @return int |
||
| 85 | */ |
||
| 86 | public function getQuantity() |
||
| 90 | |||
| 91 | /** |
||
| 92 | * @param int $amount |
||
| 93 | */ |
||
| 94 | public function reduceQuantity($amount) |
||
| 98 | } |
||
| 99 |