Correct GenericDAO implementation? I implemented a MVC Framework with Generic DAO and I would like know if is correct. I did not have developed yet the MySQLDAO.

My controller class

class ClienteController {
  public function __construct() {  }

  public function actionSubmit(){
      $objCliente = new Cliente();
      $objCliente-&gt;setNome($_POST['nome']);
      $objCliente-&gt;setCodigo($_POST['codigo']);
      $objCliente-&gt;getDAOFactory()-&gt;insert();
  }
}


DAO Class for client, persistence.

class ClienteDAO implements IRecord {
  const TABLE = 'cliente';

  private $campos = array(
                         "codigo" =&gt; "cliCod",
                         "nome"   =&gt; "cliNom"
                         );

  private  $DAOFactory;

  public function __construct() {
      $this-&gt;DAOFactory = new DAOFactory($this);
  }

  public function getDAOFactory() {
      return $this-&gt;DAOFactory-&gt;getInstance();
  }
}


Model class

class Cliente extends ClienteDAO {
  private $codigo;
  private $nome;

  public function __construct(){  }

  public function getCodigo() {
      return $this-&gt;codigo;
  }

  public function setCodigo( $codigo ) {
      if ( $codigo &gt; 0 ) {
          $this-&gt;codigo = $codigo;
      }
  }

  public function getNome() {
      return $this-&gt;nome;
  }

  public function setNome( $nome ) {
      $this-&gt;nome = $nome;
  }
}


Database class

class MySQLDao implements iDAO {
    public function insert() {

    }

    public function update() {

    }

    public function delete() {

    }

    public function limit() {

    }

    public function orderBy() {

    }

    public function findAll() {

    }

    public function addColumns() {

    }

    public function addGroupBy() {

    }

    public function addOrderBy() {

    }

    public function addHaving() {

    }

    public function addCustomizedHaving() {

    }

    public function addColumSubQuery() {

    }

    public function addAnd() {

    }

    public function addOr() {

    }

    public function checkExistanceColumn() {

    }
}


Factory class

class DAOFactory {
  private $objeto;
  private $factory;

  public function __construct($obj, $banco = null) {
      $this-&gt;factory = $banco;
      $this-&gt;objeto = $obj;
  }

  public function getFactory() {
      return $this-&gt;factory;
  }

  public function setFactory($factory) {
      $this-&gt;factory = $factory;
  }

  public static function getInstance() {
      if ($this-&gt;getFactory() == null) {
          return new MySQLDAO($this-&gt;getObjeto());
      }
  }

  public function getObjeto() {
      return $this-&gt;objeto;
  }
}


Interfaces

interface IDAO {
  public function insert();
  public function update();
  public function delete();
  public function limit();
  public function orderBy();
  public function findAll();
  public function addColumns();
  public function addGroupBy();
  public function addOrderBy();
  public function addHaving();
  public function addCustomizedHaving();
  public function addColumSubQuery();
  public function addAnd();
  public function addOr();
  public function checkExistanceColumn();
}

interface IRecord {
  public function getDAOFactory();
}
Some recommendations:


Instead of creating monolithic DAOs, you should split it in domain objects and data mappers. This way you would separate the entity-specific business logic from storage.
Do not ever use active record as default solution in any code. It has very specific and limited use-case, and when you exceed those limitation, your code becomes convoluted and hackish. Active records are good for two things: fast prototyping (creating temporary throw-away code) and implementation extremely simple domain entities with almost no business logic (glorified value objects with hard-coded storage).
Look into use of PDO. It should provide you with a bit more flexible storage infrastructure when dealing with SQL databases.
You currently have domain business logic from model layer leaking in the controller. This is kinda bad. Controller should only change the state of model layer. It should not know how to create and save entities. You might benefit from reading this answer.
Watch every lecture, that is listed here. Your code seems to suffer from tight and violations of Law of Demeter. You won't be able to understand everything, that is talked about, at first (at least , I didn't). If that happens, watch the listing till the end ad start again. Each time you will understand more of it.