Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- /**
- * Description of Settings
- *
- * @author fabi0
- */
- namespace Models;
- class Settings {
- private $_data = array();
- public function __construct($databaseInstance) {
- $sql = 'SELECT * FROM `settings` WHERE id=1 LIMIT 1';
- $databaseInstance->query($sql);
- foreach ((array) $databaseInstance->getResult()[0] as $key => $value) {
- $this->_data[$key] = $value;
- }
- }
- public function get($property) {
- return $this->_data[$property];
- }
- public function getAll() {
- return $this->_data;
- }
- /**
- *
- * @param array $values
- */
- public function get_array(array $values) {
- foreach ($values as $value) {
- $settings[$value] = $this->_data[$value];
- }
- return $settings;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment