PluginProbe
CSS & JavaScript Toolbox / 11.4
CSS & JavaScript Toolbox v11.4
trunk 0.3 0.8 10 10.1 11 11.2 11.3 11.4 11.5 11.6 11.7 11.8 11.9 11.9.1 12 12.0 12.0.1 12.0.3 12.0.4 12.0.5 12.0.6 12.0.7 6.0 6.0.11 All 60 releases
css-javascript-toolbox / framework / mvc / model.inc.php

model.inc.php in CSS & JavaScript Toolbox 11.4, at framework/mvc/model.inc.php

92 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @version model.inc.php
4 */
5
6 /**
7 * No direct access.
8 */
9 defined('ABSPATH') or die("Access denied");
10
11 /**
12 * CJT model base class.
13 */
14 abstract class CJTModel {
15
16 /**
17 * put your comment there...
18 *
19 * @var mixed
20 */
21 protected $properties = array();
22
23 /**
24 * put your comment there...
25 *
26 * @param mixed $values
27 * @return CJTModel
28 */
29 public function __construct($values) {
30 $this->setValues($values);
31 }
32
33 /**
34 * put your comment there...
35 *
36 * @deprecated Use CJTModel::getInstance.
37 */
38 public static function create($model,
39 $params = array(),
40 $file = null,
41 $overrideModelsPath = null,
42 $overrideModelsPrefix = null) {
43 return self::getInstance($model, $params, $file, $overrideModelsPath, $overrideModelsPrefix);
44 }
45
46 /**
47 * put your comment there...
48 *
49 * @param mixed $model
50 * @param mixed $params
51 * @param mixed $file
52 */
53 public static function getInstance($model,
54 $params = array(),
55 $file = null,
56 $overrideModelsPath = null,
57 $overrideModelsPrefix = null) {
58 return CJTController::getModel($model, $params, $file, $overrideModelsPath, $overrideModelsPrefix);
59 }
60
61 /**
62 * put your comment there...
63 *
64 */
65 public function getValues() {
66 return ((object)$this->properties);
67 }
68
69 /**
70 * put your comment there...
71 *
72 * @param mixed $model
73 */
74 public static function import($model) {
75 $pathToModels = CJTOOLBOX_MODELS_PATH;
76 // Import model file.
77 $modelFile = "{$pathToModels}/{$model}.php";
78 require_once $modelFile;
79 }
80
81 /**
82 * put your comment there...
83 *
84 * @param mixed $values
85 */
86 public function setValues($values) {
87 foreach ($values as $name => $value) {
88 $this->properties[$name] = $value;
89 }
90 }
91
92 } // End class.