Problem with Interface in PHP

0

Good afternoon,

I'm having trouble calling an interface I created in PHP. NetBeans recognizes it, it manages to call it, forces me to implement its methods, but when I upload the application, an error appears, telling me that the interface was not found. They are in different directories and even using the namespace and an autoload, I am not getting the interface to be found by the class in question. Could you help me ?. I saw some other solutions here, but I could not solve them.

TitleData Class, which contains the interface in question:

<?php

namespace DAO\classes;

include '..\..\autoload.php';

class TituloDAO implements \DAO\interfaces\IDAO{  

  private $conn;

  public function __construct() {



       $this->conn = new PDO("mysql:host=localhost;dbname=mydb" , "root" , "123456");

}


  public function delete() {

}

public function insert(Titulo $titulo) {

   $id = $titulo->getId();

   $desc = $titulo->getDescricao();

   $dataEmissao =  $titulo->getDataEmissao();

   $nDoc = $titulo->getNDoc();

   $dataVcto = $titulo->getDataVcto();

   $valor = $titulo->getValor();




}

public function select() {


}

public function uptade() {

}

}

The IDAO interface, which is not being "found" is this:

<?php

namespace DAO\interfaces;

interface IDAO {


        public function insert();

        public function delete();

        public function uptade();

        public function select();


}

This is the autoload:

spl_autoload_register(function($nameClass){

    $dirClass = "class";

    $filename = $dirClass . DIRECTORY_SEPARATOR . $nameClass . ".php";

    if(file_exists($filename)){

        require_once($filename);

    }

});

And a photo of my directories, if I have called some namespace wrong, if you can alert me.

    
asked by anonymous 16.07.2018 / 21:01

0 answers