Completed
Push — master ( 2a4552...89ca68 )
by Park Jong-Hun
03:06
created

EntityFinder::findById()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 2
1
<?php
2
3
namespace Core\Utils;
4
5
use Core\DatabaseManager;
6
7
class EntityFinder
8
{
9
    public static function findById($entityName, $id)
10
    {
11
        return DatabaseManager::getEntityManager()->getRepository($entityName)->find($id);
12
    }
13
14
    public static function findOneBy($entityName, $criteria, $orderBy = [])
15
    {
16
        return DatabaseManager::getEntityManager()->getRepository($entityName)->findOneBy($criteria, $orderBy);
17
    }
18
19
    public static function findAll($entityName)
20
    {
21
        return DatabaseManager::getEntityManager()->getRepository($entityName)->findAll();
22
    }
23
}
24