Models
in package
[$models = $this->core->loadClass('Models');] Class to facilitate CloudFramework models integration
Table of Contents
Properties
Methods
- __construct() : mixed
- addError() : mixed
- getApiDocFields() : null|array<string|int, mixed>
- Output mapped field in the output with APIDOC format
- getModelMapping() : array<string|int, mixed>
- Return the array with the mapping
- getSQLMappedFields() : null|string
- Return a string of SQL fields with the names Mapped
- getSQLRecordToInsert() : array<string|int, mixed>
- Return the array with the mapping
- getSQLRecordToUpdate() : array<string|int, mixed>
- Return the array with the mapping
- loadModels() : mixed
- Process array of models based on a specify structure. The array has to have the following structure: [{"table_name_1}:{"model":{"field1":[properties],"field2":[properties],..},"mapping":{"field1":{properties},..}},{}]
Properties
$apidoc
public
mixed
$apidoc
= []
$error
public
mixed
$error
= \false
$errorMsg
public
mixed
$errorMsg
= []
$models
public
mixed
$models
$core
private
mixed
$core
Methods
__construct()
public
__construct(Core7 &$core[, mixed $models = null ]) : mixed
Parameters
- $core : Core7
- $models : mixed = null
addError()
public
addError(mixed $value) : mixed
Parameters
- $value : mixed
getApiDocFields()
Output mapped field in the output with APIDOC format
public
getApiDocFields( $model[, mixed $field_name = '' ][, mixed $type = 'Success' ]) : null|array<string|int, mixed>
Parameters
Return values
null|array<string|int, mixed>getModelMapping()
Return the array with the mapping
public
getModelMapping( $model) : array<string|int, mixed>
Parameters
Return values
array<string|int, mixed>getSQLMappedFields()
Return a string of SQL fields with the names Mapped
public
getSQLMappedFields( $model[, null $fields = null ]) : null|string
Parameters
Return values
null|stringgetSQLRecordToInsert()
Return the array with the mapping
public
getSQLRecordToInsert( $model, mixed &$data) : array<string|int, mixed>
Parameters
Return values
array<string|int, mixed>getSQLRecordToUpdate()
Return the array with the mapping
public
getSQLRecordToUpdate( $model, mixed &$data) : array<string|int, mixed>
Parameters
Return values
array<string|int, mixed>loadModels()
Process array of models based on a specify structure. The array has to have the following structure: [{"table_name_1}:{"model":{"field1":[properties],"field2":[properties],..},"mapping":{"field1":{properties},..}},{}]
public
loadModels( &$models) : mixed