chamilo/chamilo-lms

View on GitHub
public/plugin/toplinks/src/Entity/Repository/TopLinkRepository.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

/* For license terms, see /license.txt */

namespace Chamilo\PluginBundle\Entity\TopLinks\Repository;

use Doctrine\ORM\EntityRepository;

/**
 * Class TopLinkRepository.
 *
 * @package Chamilo\PluginBundle\Entity\TopLinks
 */
class TopLinkRepository extends EntityRepository
{
    public function all($offset, $limit, $column, $direction): array
    {
        $orderBy = ['title' => $direction];

        if (1 == $column) {
            $orderBy = ['url' => $direction];
        }

        return parent::findBy([], $orderBy, $limit, $offset);
    }
}