public function select_by_id($id)
 {
     $connection = Connetor::get_connection();
     $result_set = $connection->query("SELECT * FROM users WHERE id={$id}");
     $row = $result_set->fetch(PDO::FETCH_ASSOC);
     return new User($row["id"], $row["email"]);
 }
 public function select_all_buffered_items()
 {
     $connection = Connetor::get_connection();
     $result_set = $connection->query("SELECT * FROM items INNER JOIN buffered_items ON items.id=buffered_items.item_id\n              WHERE status=2 AND id IN (SELECT item_id FROM buffered_items) ORDER BY publicated_to");
     return $this->build_items_set($result_set);
 }
 public function delete_item(Item $item)
 {
     $connection = Connetor::get_connection();
     $connection->query("DELETE FROM buffered_items WHERE item_id={$item->id}");
     $connection = null;
 }