PropriedadeSoftwareRepository.php
1.17 KB
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
<?php
namespace Cacic\CommonBundle\Entity;
use Doctrine\ORM\EntityRepository;
/**
* PropriedadeSoftwareRepository
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
class PropriedadeSoftwareRepository extends EntityRepository
{
/**
* Retorna lista de todas as propriedades coletadas
*
* @return mixed
*/
public function propPorNome( $nmSoftware ) {
$qb = $this->createQueryBuilder('prop')
->select('prop')
->innerJoin('CacicCommonBundle:Software', 'sw', 'WITH', 'sw.idSoftware = prop.software')
->andWhere('sw.nmSoftware = :nmSoftware')
->setParameter('nmSoftware', $nmSoftware);
return $qb->getQuery()->execute();
}
public function softwareByName( $nmSoftware ) {
$qb = $this->createQueryBuilder('prop')
->select('prop')
->innerJoin('CacicCommonBundle:classProperty', 'cp', 'WITH', 'prop.classProperty = cp.idClassProperty')
->andWhere('cp.nmPropertyName = :nmSoftware')
->setParameter('nmSoftware', $nmSoftware);
return $qb->getQuery()->getOneOrNullResult();
}
}