Ejemplo n.º 1
0
 function Query($query)
 {
     $this->query = $query;
     $connection = WPWB_Database::Connect();
     $thisObjectName = get_class($this);
     $cursors = WPWB_Database::Reader($this->query, $connection);
     if (!empty($cursors)) {
         foreach ($cursors as $row) {
             $obj = new $thisObjectName();
             $obj->fill($row);
             $objects[] = $obj;
         }
         return $objects;
     }
 }
Ejemplo n.º 2
0
 function Delete()
 {
     $connection = WPWB_Database::Connect();
     $this->query = $connection->prepare("DELETE FROM {$this->table} WHERE {$this->unique}='%d'", $this->{$this->unique});
     return WPWB_Database::NonQuery($this->query, $connection);
 }