RoomRepository::findOneByXandY()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 2
1
<?php
2
3
namespace Rottenwood\KingdomBundle\Entity\Infrastructure;
4
5
use Rottenwood\KingdomBundle\Entity\Room;
6
7
/** {@inheritDoc} */
8
class RoomRepository extends AbstractRepository
9
{
10
11
    /**
12
     * Поиск по координатам
13
     * @param int $x
14
     * @param int $y
15
     * @return Room|null
16
     */
17
    public function findOneByXandY($x, $y)
18
    {
19
        return $this->findOneBy(['x' => $x, 'y' => $y]);
20
    }
21
22
    /**
23
     * Поиск всех комнат
24
     * @return Room[]
25
     */
26
    public function findAllRooms()
27
    {
28
        return $this->findAll();
29
    }
30
}
31