text: Q:
  
  How do I make a generic DAO interface in PHP?
  
  I'm trying to write a generic DAO interface in PHP. I know what it looks like in Java, but I only have an idea of what it looks like in PHP.
  I've tried this in PHP.
  <?php
   interface DAO {
  
      public function create($obj);
      public function read();
      public function update($obj);
      public function delete($obj);
   }
  
  Because I want something like this Java interface
  public interface DAO<T> {
  
      void create(T ob);
      List<T> read();
      void update(T ob);
      void delete(String id);
  
  }
  
  I expected to be able to just write the interface the same way I did in PHP, but I can't add the generic object to the interface.
  
  A:
  
  The simplest form of a generic DAO is to provide the basic CRUD operations at an object level without exposing the internals of the persistence mechanism.
  interface UserDao
  {
      /**
       * Store the new user and assign a unique auto-generated ID.
       */
      function create($user);
  
      /**
       * Return the user with the given auto-generated ID.
       */
      function findById($id);
  
      /**
       * Return the user with the given login ID.
       */
      function findByLogin($login);
  
      /**
       * Update the user's fields.
       */
      function update($user);
  
      /**
       * Delete the user from the database.
       */
      function delete($user);
  }
  
  