<?php

include_once 'Conexao.class.php';

/**
 * Description of DAOInteressados
 *
 * @author Eticons
 */
class DAOInteressados {

    private $conexao = null;

    function __construct() {
        $this->conexao = new Conexao();
    }

    public function buscaInteressados($query) {
        try {
            $con = $this->conexao->getConexao();
            $stmt = $con->query($query);
            $this->conexao->desconectar();
            $i = 0;
            $lista = array();
            if ($stmt) {
                while ($row = $stmt->fetchObject(get_class(new Interessados()))) {
                    $lista[$i] = $row;
                    $i++;
                }
                return $lista;
            } else {
                return array();
            }
        } catch (PDOException $ex) {
            die($ex->getMessage());
        }
    }

}

?>
