1 | <?php |
||
20 | class ModelSchema |
||
21 | { |
||
22 | /** |
||
23 | * Return the schema for a given model from a given model. |
||
24 | * @param \EEM_Base $model |
||
25 | * @return array |
||
26 | */ |
||
27 | public function getModelSchema(EEM_Base $model) |
||
35 | |||
36 | |||
37 | /** |
||
38 | * Get the schema for a given set of model fields. |
||
39 | * @param \EE_Model_Field_Base[] $model_fields |
||
40 | * @return array |
||
41 | */ |
||
42 | public function getModelSchemaForFields(array $model_fields) |
||
53 | |||
54 | |||
55 | /** |
||
56 | * Get the schema for a given set of model relations |
||
57 | * @param EE_Model_Relation_Base[] $relations_on_model |
||
58 | */ |
||
59 | public function getModelSchemaForRelations(array $relations_on_model) |
||
77 | |||
78 | |||
79 | /** |
||
80 | * Outputs the schema header for a model. |
||
81 | * @param \EEM_Base $model |
||
82 | * @return array |
||
83 | */ |
||
84 | public function getInitialSchemaStructure(EEM_Base $model) |
||
93 | |||
94 | |||
95 | /** |
||
96 | * Helper function that simply allows one to get whatever has been generated in an actual json object as opposed to |
||
97 | * an array. |
||
98 | * @param array $array_to_convert |
||
99 | * @return bool|false|mixed|string |
||
100 | */ |
||
101 | public function toJson($array_to_convert) |
||
105 | } |
||
106 |