Advertisement
fabi0

Untitled

May 20th, 2014
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.80 KB | None | 0 0
  1. <?php
  2.  
  3. /*
  4.  * To change this license header, choose License Headers in Project Properties.
  5.  * To change this template file, choose Tools | Templates
  6.  * and open the template in the editor.
  7.  */
  8.  
  9. /**
  10.  * Description of Settings
  11.  *
  12.  * @author fabi0
  13.  */
  14.  
  15. namespace Models;
  16.  
  17. class Settings {
  18.  
  19.     private $_data = array();
  20.  
  21.     public function __construct() {
  22.         $database = \Models\DB::getInstance();
  23.         $sql = 'SELECT * FROM `settings` WHERE id=1 LIMIT 1';
  24.         $database->query($sql);
  25.         //echo "<pre>" . print_r($database->getResult()[0], TRUE) . "</pre>";
  26.         foreach ((array) $database->getResult()[0] as $key => $value) {
  27.             $this->_data[$key] = $value;
  28.         }
  29.     }
  30.  
  31.     public function get($property) {
  32.         return $this->_data[$property];
  33.     }
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement