Documentation

Models
in package

[$models = $this->core->loadClass('Models');] Class to facilitate CloudFramework models integration

Table of Contents

Properties

$apidoc  : mixed
$error  : mixed
$errorMsg  : mixed
$models  : mixed
$core  : mixed

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 = []

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
$model :
$field_name : mixed = ''
$type : mixed = 'Success'
Return values
null|array<string|int, mixed>

getModelMapping()

Return the array with the mapping

public getModelMapping( $model) : array<string|int, mixed>
Parameters
$model :
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
$model :
$fields : null = null
Return values
null|string

getSQLRecordToInsert()

Return the array with the mapping

public getSQLRecordToInsert( $model, mixed &$data) : array<string|int, mixed>
Parameters
$model :
$data : mixed
Return values
array<string|int, mixed>

getSQLRecordToUpdate()

Return the array with the mapping

public getSQLRecordToUpdate( $model, mixed &$data) : array<string|int, mixed>
Parameters
$model :
$data : mixed
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
Parameters
$models :

        
On this page

Search results