m1k1oblog/application/core/model.php
Miroslav Šedivý cf64c88f27 Initial MVC
2017-02-09 22:05:46 +01:00

30 lines
No EOL
536 B
PHP

<?php
namespace Core;
abstract class Model
{
protected $_DB;
protected $_safe_input;
private static $_instance = null;
public final static function get_instance(){
if(self::$_instance == null){
self::$_instance = new static();
}
return self::$_instance;
}
protected function __construct(){
$this->_DB = DB::get_instance();
}
protected function input(&$data){
foreach($data as $key => &$value){
if(!array_key_exists($key, $this->_safe_input)){
unset($value);
}
}
}
}