I'm getting the data from a form screen.
<?php
include_once '../model/dao/FitaDao.php';
include_once '../model/vo/FitaVO.php';
include_once '../model/vo/FilmeVO.php';
include_once '../model/vo/CategoriaFilmeVO.php';
include_once '../model/vo/ArtistaVO.php';
class FitaController {
public function insereFita(FitaVo $fita){
$fd = new FitaDao();
$fd->insereMidia($fita);
}
}
switch($_POST['acao']){
case 1:{
$categoria = new CategoriaFilmeVO($_POST['categoria']);
$artista = new ArtistaVO($_POST['artista'], $_POST['data']);
$filme = new FilmeVO($_POST['titulo'], $categoria);
$filme->adicionaArtistas($artista);
$fita = new FitaVO($_POST['formato'], $_POST['ano'], $filme);
$fc = new FitaController();
$fc->insereFita($fita);
break;
}
}
?>
So that's fine, but when I call the class fitaDao
, it can not find the path of the Conexao
class.
<?php
require_once "../../conexao/Conexao.php";
include_once '../vo/CategoriaFilmeVO.php';
include_once '../vo/ArtistaVO.php';
include_once '../vo/FilmeVO.php';
include_once '../vo/FitaVO.php';
class FitaDao {
private $conexao;
function __construct(){
$conexao = new Conexao();
$this->conexao = $conexao->conectar();
$this->conexao->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING );
}
?>
Generating the error:
Warning: require_once (../../ connection / Connection.php): failed to open stream: No such file or directory in C: \ xampp \ htdocs \ vintagelocadora \ app \ model \ dao \ FitaDao.php on line 2
Fatal error: require_once (): Failed opening required '../../connection/Conexao.php' (include_path = 'C: \ xampp \ php \ PEAR') in C: \ xampp \ htdocs \ vintagelocator \ app \ model \ dao \ FitaDao.php on line 2