Example #1
0
	/**
	 * @throws ProblemaAcessoDadosException
	 */
	public function excluir(ImagemOS $imagemOS){
		try{
	
			parent::delete($imagemOS);
				
		} catch (\Exception $ex){
			$msgLogger = self::MSG_PROBLEMA_EXCLUIR . " - " . $ex->getMessage();
			FacilLogger::getLogger()->error($msgLogger);
			throw new ProblemaAcessoDadosException(self::MSG_PROBLEMA_EXCLUIR);
		}
	}
Example #2
0
	/**
	 * @throws ProblemaAcessoDadosException
	 * @return Menu $menu
	 */
	public function buscarMenu(Menu $menu){
		try{
	
			return parent::findBy($menu, array('id' => $menu->id));
	
		}catch (\Exception $ex){
			$msgLogger = self::MSG_PROBLEMA_LISTAR . FacilLogger::gerarLogException($ex);
			FacilLogger::getLogger()->error($msgLogger);
			throw new ProblemaAcessoDadosException(self::MSG_PROBLEMA_LISTAR);
		}
	}
Example #3
0
	/**
	 * @param Permissao $permissao
	 * @throws ProblemaAcessoDadosException
	 */
	public function inserir(Permissao $permissao){
		try{
			
			return parent::insert($permissao);
			
		}catch (\Exception $ex){
	
			$msgLogger = self::MSG_PROBLEMA_INSERIR . FacilLogger::gerarLogException($ex);
			FacilLogger::getLogger()->error($msgLogger);
			throw new ProblemaAcessoDadosException(self::MSG_PROBLEMA_INSERIR);
		}
	}
Example #4
0
	/**
	 * listar todos por perfil.
	 * @throws ProblemaAcessoDadosException
	 * @return ArrayCollection
	 */
	public function listarPorPerfil(Perfil $perfil){
		try{
			
			$criteria = Criteria::expr()->eq('perfil', $perfil);
			return parent::findWithCriteria(new Usuario(), $criteria);
	
		}catch (\Exception $ex){
			$msgLogger = self::MSG_PROBLEMA_LISTAR . FacilLogger::gerarLogException($ex);
			FacilLogger::getLogger()->error($msgLogger);
			throw new ProblemaAcessoDadosException(self::MSG_PROBLEMA_LISTAR);
		}
	}