initial commit with snapshot 20140213

This commit is contained in:
2015-02-14 12:01:53 +01:00
commit 12cd5888c5
93 changed files with 7038 additions and 0 deletions

34
inc/askModel.class.php Normal file
View File

@@ -0,0 +1,34 @@
<?php
abstract class AskModel
{
protected $models = array();
function loadModel($model)
{
if (file_exists('./inc/models/'.$model.'.class.php') && !array_key_exists($model, $this->models)) //realizowany singleton
{
require_once('./inc/models/'.$model.'.class.php');
$this->models[$model] = new $model($this->db);
}
else
{
throw new Exception('Could not load selected model: '.$model);
}
}
function getModel($model)
{
if (array_key_exists($model, $this->models))
return $this->models[$model];
else
throw new Exception('Could not get selected model: '.$model);
}
function putExistingModel($model, &$model_ptr)
{
$this->models[$model] = $model_ptr;
}
}
?>