Exemple #1
0
 /**
  * Delete the object in the database 
  * @param  Object $obj
  * @return void
  */
 static function delete($obj)
 {
     $var = self::getAttributes($obj);
     $pk = static::$props['PK'];
     $sql = "DELETE FROM {$var['table']} WHERE {$pk} = ?";
     $stmt = Conexao::getConnection()->prepare($sql);
     $stmt->bindValue(1, $obj->{$pk});
     $stmt->execute();
     Conexao::closeConnection();
 }