function books() { $objs = new Book(); $objs->get(); $data = array('books' => $objs); $this->load->view('backend/books', $data); }
public function testTicket2() { $obj = new Book(); $obj->set('name', 'yes2'); $obj->save(); $this->assertEqual($obj->get('name'), 'yes2'); $obj->save(); }
function setUp() { include 'mysql_conn.php'; $isbn = new Isbn('0596002068'); $book = new Book(array('author' => 'Linke, Maikel', 'title' => 'uBook Test', 'isbn' => $isbn->toString(), 'price' => '0,00', 'year' => '2011', 'description' => 'This is only a test.')); $query = 'insert into books' . ' (id, author, title, isbn, price, year, description) values' . ' (1, "' . $book->get('author') . '", "' . $book->get('title') . '", "' . $book->get('isbn') . '", "' . $book->get('price') . '", "' . $book->get('year') . '", "' . $book->get('description') . '");'; mysql_query($query); $this->isbn = $isbn; $this->book = $book; }
public function getBook() { $book = new Book(); return $book->get("id = " . $this->book_id); }
function detalhe($id) { global $twig; $book = new Book(); echo $twig->render('book_detail.html', array('book' => $book->get("id = {$id}"))); }