Passed
Pull Request — 1.11.x (#4900)
by Angel Fernando Quiroz
09:30
created

LogRepository   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
eloc 8
c 2
b 0
f 0
dl 0
loc 16
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A countByActionInExe() 0 5 1
A countByActionAndLevel() 0 6 1
1
<?php
2
3
/* For licensing terms, see /license.txt */
4
5
namespace Chamilo\PluginBundle\ExerciseFocused\Repository;
6
7
use Chamilo\CoreBundle\Entity\TrackEExercises;
8
use Doctrine\ORM\EntityRepository;
9
10
class LogRepository extends EntityRepository
11
{
12
    public function countByActionInExe(TrackEExercises $exe, string $action): int
13
    {
14
        return $this->count([
15
            'exe' => $exe,
16
            'action' => $action,
17
        ]);
18
    }
19
20
    public function countByActionAndLevel(TrackEExercises $exe, string $action, int $level): int
21
    {
22
        return $this->count([
23
            'exe' => $exe,
24
            'action' => $action,
25
            'level' => $level,
26
        ]);
27
    }
28
}
29