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

42 lines
1009 B

<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\CoreBundle\Repository;
use Chamilo\CoreBundle\Entity\Language;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Common\Persistence\ManagerRegistry;
/**
* Class LanguageRepository.
*/
class LanguageRepository extends ServiceEntityRepository
{
/**
* LanguageRepository constructor.
*/
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();
}
}