PHP 5 using VO and DAO Classes

Discussion in 'PHP' started by piropeator, Aug 10, 2011.

  1. #1
    I have code using this classes:

    Pedido.CLASS.PHP
    <?php
    
    class PedidoVO {
      var $idPedido;
      var $idUsuario;
      var $fecha;
      var $estado;
      var $detallePedido = array();
    
      function PedidoVO($ip, $iu, $f, $e){
         $this->idPedido = $ip;
         $this->idUsuario = $iu;
         $this->fecha = $f;
         $this->estado = $e;
      }
    }
    
    ?>
    PHP:
    and this:

    PedidoDAO.CLASS.PHP
    <?php
    
    class PedidoDAO {
      function PedidoDAO(){
      }
        function obtener($id){
    
          $DB = new ConexionDB();
    
          $query = "SELECT id_pedido, id_usuario, fecha, estado ";
          $query .= " FROM pedido WHERE id_pedido=".$id;
    
          $recordSet = $DB->dbLink->Execute($query);
    
          if (!$recordSet || ($recordSet->RecordCount() <= 0)) {
             Debug::println("PedidoDAO: obtener: " . $DB->dbLink->ErrorMsg());
             return false;
          } else {
            $fila = $recordSet->FetchRow();
            $vo = new PedidoVO($fila['id_pedido'],
                               $fila['id_usuario'],
                               $fila['fecha'],
                               $fila['estado']);
          }
          return $vo;
        }
    }
    ?>
    PHP:
    This code mean is using OOP with PHP5 ?
     
    piropeator, Aug 10, 2011 IP
  2. ModulesGarden

    ModulesGarden Active Member

    Messages:
    21
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    58
    #2
    I am not sure if I get you right, but yes, this code is using OOP.
     
    ModulesGarden, Aug 10, 2011 IP
  3. piropeator

    piropeator Well-Known Member

    Messages:
    194
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    121
    #3
    I don't find documentation about this classes.:confused:
     
    piropeator, Aug 11, 2011 IP