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

OrmUuidEntityRepository   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 17
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A findByUuid() 0 8 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