Completed
Push — master ( 1faee5...d14607 )
by Tim
15:03
created

DimensionRepository::getTableName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
/**
3
 * DimensionRepository.
4
 */
5
6
namespace HDNET\Focuspoint\Domain\Repository;
7
8
/**
9
 * DimensionRepository.
10
 */
11
class DimensionRepository extends AbstractRawRepository
12
{
13
    /**
14
     * Find one by identifier.
15
     *
16
     * @param string $identifier
17
     *
18
     * @return array|null
19
     */
20
    public function findOneByIdentifier(string $identifier)
21
    {
22
        $queryBuilder = $this->getQueryBuilder();
23
        $rows = $queryBuilder->select('*')
24
            ->from($this->getTableName())
25
            ->where(
26
                $queryBuilder->expr()->eq('identifier', $queryBuilder->createNamedParameter($identifier))
27
            )
28
            ->execute()
29
            ->fetchAll();
30
31
        return $rows[0] ?? null;
32
    }
33
34
    /**
35
     * Get the tablename.
36
     *
37
     * @return string
38
     */
39
    protected function getTableName(): string
40
    {
41
        return 'tx_focuspoint_domain_model_dimension';
42
    }
43
}
44