public function get_items() { global $g_pdo; $request = <<<EOF SELECT id FROM `item` WHERE `id_bill`= :id EOF; debug($request); $pst = $g_pdo->prepare($request); $pst->execute(array(":id" => $this->id)); $items = array(); while ($record = $pst->fetch()) { $id = $record['id']; $item = Item::get_from_id($id); $items[] = $item; } return $items; }