Completed
Push — master ( fbd8ce...78ab46 )
by Philip
21:27
created

OrmUuidEntityRepository::findByUuid()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 8
rs 9.4285
cc 1
eloc 4
nc 1
nop 1
1
<?php
2
3
namespace Dontdrinkandroot\Repository;
4
5
use Dontdrinkandroot\Entity\UuidEntityInterface;
6
7
class OrmUuidEntityRepository extends OrmEntityRepository
8
{
9
10
    /**
11
     * @param string $uuid
12
     *
13
     * @return UuidEntityInterface|null
14
     */
15
    public function findByUuid($uuid)
16
    {
17
        return $this->getTransactionManager()->transactional(
18
            function () use ($uuid) {
19
                return $this->findOneBy(['uuid' => $uuid]);
20
            }
21
        );
22
    }
23
}
24