You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1.1 KiB
36 lines
1.1 KiB
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/* For licensing terms, see /license.txt */
|
|
|
|
namespace Chamilo\CourseBundle\Repository;
|
|
|
|
use Chamilo\CoreBundle\Entity\ResourceInterface;
|
|
use Chamilo\CoreBundle\Repository\ResourceRepository;
|
|
use Chamilo\CoreBundle\Repository\ResourceWithLinkInterface;
|
|
use Chamilo\CourseBundle\Entity\CLpCategory;
|
|
use Doctrine\Persistence\ManagerRegistry;
|
|
use Symfony\Component\Routing\RouterInterface;
|
|
|
|
final class CLpCategoryRepository extends ResourceRepository implements ResourceWithLinkInterface
|
|
{
|
|
public function __construct(ManagerRegistry $registry)
|
|
{
|
|
parent::__construct($registry, CLpCategory::class);
|
|
}
|
|
|
|
public function getLink(ResourceInterface $resource, RouterInterface $router, array $extraParams = []): string
|
|
{
|
|
$params = [
|
|
'id' => $resource->getResourceIdentifier(),
|
|
'name' => 'lp/lp_controller.php',
|
|
'action' => 'view_category',
|
|
];
|
|
if (!empty($extraParams)) {
|
|
$params = array_merge($params, $extraParams);
|
|
}
|
|
|
|
return $router->generate('legacy_main', $params);
|
|
}
|
|
}
|
|
|