Advertisement
Guest User

Untitled

a guest
Jun 1st, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. class Model {
  2. public function connectToDB(){
  3. $dsn= 'mysql:dbname=secondhand;host=127.0.0.1';
  4. $user = 'root';
  5. $password = '';
  6. $db = new PDO($dsn, $user, $password);
  7. return $db;
  8. }
  9. public function getCategoryList()
  10. {
  11. // here goes some hardcoded values to simulate the database
  12. return array(
  13. "category1" => new Category("category1"),
  14. "category2" => new Category("category2"),
  15. "category3" => new Category("category3")
  16. );
  17. }
  18.  
  19.  
  20.  
  21. public function newItem(){
  22.  
  23. }
  24.  
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement