1 | <?php |
||
18 | class Base extends Controller_Base |
||
19 | { |
||
20 | |||
21 | /** |
||
22 | * Holds reference to the model version info, which knows the requested version |
||
23 | * |
||
24 | * @var ModelVersionInfo |
||
25 | */ |
||
26 | protected $model_version_info; |
||
27 | |||
28 | |||
29 | |||
30 | /** |
||
31 | * Sets the version the user requested |
||
32 | * |
||
33 | * @param string $version eg '4.8' |
||
34 | */ |
||
35 | public function setRequestedVersion($version) |
||
40 | |||
41 | |||
42 | |||
43 | /** |
||
44 | * Gets the object that should be used for getting any info from the models, |
||
45 | * because it's takes the requested and current core version into account |
||
46 | * |
||
47 | * @return \EventEspresso\core\libraries\rest_api\ModelVersionInfo |
||
48 | * @throws EE_Error |
||
49 | */ |
||
50 | public function getModelVersionInfo() |
||
64 | |||
65 | |||
66 | |||
67 | /** |
||
68 | * Determines if $object is of one of the classes of $classes. Similar to |
||
69 | * in_array(), except this checks if $object is a subclass of the classnames provided |
||
70 | * in $classnames |
||
71 | * |
||
72 | * @param object $object |
||
73 | * @param array $classnames |
||
74 | * @return boolean |
||
75 | */ |
||
76 | public function isSubclassOfOne($object, $classnames) |
||
85 | |||
86 | /** |
||
87 | * Verifies the model name provided was valid. If so, returns the model (as an object). Otherwise, throws an |
||
88 | * exception. Must be called after `setRequestedVersion()`. |
||
89 | * @since $VID:$ |
||
90 | * @param $model_name |
||
91 | * @return EEM_Base |
||
92 | * @throws EE_Error |
||
93 | * @throws RestException |
||
94 | */ |
||
95 | protected function validateModel($model_name) |
||
111 | } |
||
112 | // End of file Base.php |
||
113 |