# css-javascript-toolbox/6.0.11/framework/mvc/model.inc.php

CSS &amp; JavaScript Toolbox, version 6.0.11. 84 lines.

- Page: https://pluginprobe.com/plugins/css-javascript-toolbox/6.0.11/code/framework/mvc/model.inc.php
- Raw: https://pluginprobe.com/plugins/css-javascript-toolbox/6.0.11/raw/framework/mvc/model.inc.php
- Modified: 2013-03-23T22:50:16+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/css-javascript-toolbox/6.0.11/code/framework/mvc/model.inc.php#L10-L20`.

```php
<?php
/**
* @version model.inc.php
*/

/**
* No direct access.
*/
defined('ABSPATH') or die("Access denied");

/**
* CJT model base class.
*/
abstract class CJTModel {

	/**
	* put your comment there...
	* 
	* @var mixed
	*/
	protected $properties = array();
	
	/**
	* put your comment there...
	* 
	* @param mixed $values
	* @return CJTModel
	*/
	public function __construct($values) {
		$this->setValues($values);
	}
	
	/**
	* put your comment there...
	* 
	* @deprecated Use CJTModel::getInstance.
	*/
	public static function create($model, $params = array(), $file = null) {
		return self::getInstance($model, $params, $file);
	}
	
	/**
	* put your comment there...
	* 
	* @param mixed $model
	* @param mixed $params
	* @param mixed $file
	*/
	public static function getInstance($model, $params = array(), $file = null) {
		return CJTController::getModel($model, $params, $file);
	}
	
	/**
	* put your comment there...
	* 
	*/
	public function getValues() {
		return ((object)$this->properties);
	}
	
	/**
	* put your comment there...
	* 
	* @param mixed $model
	*/
	public static function import($model) {
		$pathToModels = CJTOOLBOX_MODELS_PATH;
		// Import model file.
		$modelFile = "{$pathToModels}/{$model}.php";
		require_once $modelFile;
	}
	
	/**
	* put your comment there...
	* 
	* @param mixed $values
	*/
	public function setValues($values) {
		foreach ($values as $name => $value) {
			$this->properties[$name] = $value;
		}
	}
	
} // End class.
```
