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.
40 lines
956 B
40 lines
956 B
|
10 years ago
|
<?php
|
||
|
|
/* For licensing terms, see /license.txt */
|
||
|
|
|
||
|
8 years ago
|
namespace Chamilo\CoreBundle\Repository;
|
||
|
10 years ago
|
|
||
|
|
use Chamilo\CoreBundle\Entity\ExtraFieldOptions;
|
||
|
|
use Doctrine\ORM\EntityRepository;
|
||
|
|
|
||
|
|
/**
|
||
|
8 years ago
|
* Class ExtraFieldOptionsRepository.
|
||
|
|
*
|
||
|
8 years ago
|
* @package Chamilo\CoreBundle\Repository
|
||
|
10 years ago
|
*/
|
||
|
|
class ExtraFieldOptionsRepository extends EntityRepository
|
||
|
|
{
|
||
|
|
/**
|
||
|
8 years ago
|
* Get the secondary options. For double select extra field.
|
||
|
|
*
|
||
|
10 years ago
|
* @param ExtraFieldOptions $option
|
||
|
8 years ago
|
*
|
||
|
10 years ago
|
* @return array
|
||
|
|
*/
|
||
|
|
public function findSecondaryOptions(ExtraFieldOptions $option)
|
||
|
|
{
|
||
|
|
$qb = $this->createQueryBuilder('so');
|
||
|
|
$qb
|
||
|
|
->where(
|
||
|
|
$qb->expr()->eq('so.field', $option->getField()->getId())
|
||
|
|
)
|
||
|
|
->andWhere(
|
||
|
|
$qb->expr()->eq('so.value', $option->getId())
|
||
|
|
)
|
||
|
|
->orderBy('so.displayText', 'ASC');
|
||
|
|
|
||
|
|
return $qb
|
||
|
|
->getQuery()
|
||
|
|
->getResult();
|
||
|
|
}
|
||
|
|
}
|