Chamilo is a learning management system focused on ease of use and accessibility
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.
chamilo-lms/src/CoreBundle/Repository/LanguageRepository.php

40 lines
945 B

<?php
declare(strict_types=1);
/* For licensing terms, see /license.txt */
namespace Chamilo\CoreBundle\Repository;
use Chamilo\CoreBundle\Entity\Language;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
class LanguageRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, Language::class);
}
/**
* Get all the sub languages that are made available by the admin.
*
* @return array
*/
public function findAllPlatformSubLanguages()
{
$qb = $this->createQueryBuilder('l');
$qb->select('l')
->where(
$qb->expr()->eq('l.available', true)
)
->andWhere(
$qb->expr()->isNotNull('l.parent')
)
;
return $qb->getQuery()->getResult();
}
}