Passed
Push — master ( fc8817...f91339 )
by Angel Fernando Quiroz
10:10 queued 10s
created

TopLinkRepository   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 11
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A all() 0 9 2
1
<?php
2
3
/* For license terms, see /license.txt */
4
5
namespace Chamilo\PluginBundle\TopLinks\Entity\Repository;
6
7
use Doctrine\ORM\EntityRepository;
8
9
/**
10
 * Class TopLinkRepository.
11
 */
12
class TopLinkRepository extends EntityRepository
13
{
14
    public function all($offset, $limit, $column, $direction): array
15
    {
16
        $orderBy = ['title' => $direction];
17
18
        if (1 == $column) {
19
            $orderBy = ['url' => $direction];
20
        }
21
22
        return parent::findBy([], $orderBy, $limit, $offset);
23
    }
24
}
25