Commit c9195290b229b3049cf473c4cc5524846bbed2ba
1 parent
92b44010
Exists in
master
and in
1 other branch
habilita e desabilita redes
Showing
1 changed file
with
4 additions
and
3 deletions
Show diff stats
src/Cacic/CommonBundle/Entity/AcaoRedeRepository.php
| ... | ... | @@ -52,11 +52,12 @@ class AcaoRedeRepository extends EntityRepository |
| 52 | 52 | { |
| 53 | 53 | $em = $this->getEntityManager(); |
| 54 | 54 | $redesLocal = $em->getRepository( 'CacicCommonBundle:Rede' )->getArrayChaveValorPorLocal( $local ); |
| 55 | - | |
| 55 | + | |
| 56 | 56 | foreach ( $redesLocal as $idRede => $nmRede ) |
| 57 | 57 | { |
| 58 | - $obj = $this->find( array( 'acao'=>$acao, 'rede'=>$idRede ) ); | |
| 59 | - if ( $obj ) $em->remove( $obj ); | |
| 58 | + $arr = $this->findBy( array( 'acao'=>$acao, 'rede'=>$idRede ) ); | |
| 59 | + foreach ( $arr as $obj ) | |
| 60 | + $em->remove( $obj ); | |
| 60 | 61 | } |
| 61 | 62 | |
| 62 | 63 | $em->flush(); | ... | ... |