ConfiguracaoPadraoRepository.php
917 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
namespace Cacic\CommonBundle\Entity;
use Doctrine\ORM\EntityRepository;
/**
* ConfiguracaoPadraoRepository
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
class ConfiguracaoPadraoRepository extends EntityRepository
{
/**
*
* Método de listagem das configurações padrão salvas no sistema
*/
public function listar()
{
$_dql = "SELECT cp
FROM CacicCommonBundle:ConfiguracaoPadrao cp";
$query = $this->getEntityManager()->createQuery( $_dql );
return $query->getArrayResult();
}
/**
*
* Recupera um array na forma [idConfiguracao] => [vlConfiguracao]
*/
public function getArrayChaveValor()
{
$configuracoes = $this->listar();
$return = array();
foreach ( $configuracoes as $config )
{
$return[ $config['idConfiguracao'] ] = $config[ 'vlConfiguracao' ];
}
return $return;
}
}