Documentation

ModelBase extends Model
in package

Base class of all models

Table of Contents

checkHasOne()  : bool
Check if current model has a hasOne relation with the target, if true add field in \Phalcon\Builder\Form $excludes static variable
filterParams()  : array<string|int, mixed>
Merge params with columns description
getColumnsDescription()  : array<string|int, mixed>
Get descriptions of all columns of the model
getColumnsMap()  : array<string|int, mixed>
Get columns map
getErrors()  : array<string|int, mixed>
Get erros from a PHQL query
getMapped()  : string
Get the field name mapped
getPrefix()  : string
Get model prefix
getPrimaryKey()  : array<string|int, mixed>
Get primary key
getReferencedField()  : string|array<string|int, mixed>|false
Get referenced field(s) with a model having hasOne relation, return false if not found
getRelations()  : void
Set relations in \Phalcon\Builder\Form $relations static variable
getRequired()  : array<string|int, mixed>
Get required columns
getType()  : string|false
Get field type
initialize()  : void
Add automatic values for fields created_at and updated_at on creation and update
returnRelations()  : array<string|int, mixed>
Get all relation by type

Methods

checkHasOne()

Check if current model has a hasOne relation with the target, if true add field in \Phalcon\Builder\Form $excludes static variable

public static checkHasOne(string $target) : bool
Parameters
$target : string

Name of the model to check with

Return values
bool

Result of the check

filterParams()

Merge params with columns description

public static filterParams(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
$params : array<string|int, mixed>

Params to add to columns description

Return values
array<string|int, mixed>

Result of the merge

getColumnsDescription()

Get descriptions of all columns of the model

public static getColumnsDescription([null|array<string|int, mixed> $excludes = [] ]) : array<string|int, mixed>
Parameters
$excludes : null|array<string|int, mixed> = []
Return values
array<string|int, mixed>

Columns description

getColumnsMap()

Get columns map

public static getColumnsMap() : array<string|int, mixed>
Return values
array<string|int, mixed>

Columns map

getErrors()

Get erros from a PHQL query

public getErrors([null|array<string|int, mixed> $errors = [] ]) : array<string|int, mixed>
Parameters
$errors : null|array<string|int, mixed> = []
Return values
array<string|int, mixed>

Errors of the query

getMapped()

Get the field name mapped

public static getMapped(string $field) : string
Parameters
$field : string

Field name to map

Return values
string

Field name mapped

getPrefix()

Get model prefix

public static getPrefix() : string
Return values
string

Model prefix

getPrimaryKey()

Get primary key

public static getPrimaryKey() : array<string|int, mixed>
Return values
array<string|int, mixed>

Prmary key

getReferencedField()

Get referenced field(s) with a model having hasOne relation, return false if not found

public static getReferencedField(string $model) : string|array<string|int, mixed>|false
Parameters
$model : string

Name of the model to get whith

Return values
string|array<string|int, mixed>|false

Field name or list or false if not found

getRelations()

Set relations in \Phalcon\Builder\Form $relations static variable

public static getRelations(string $type) : void
Parameters
$type : string

Type of the relation

Return values
void

getRequired()

Get required columns

public static getRequired() : array<string|int, mixed>
Return values
array<string|int, mixed>

List of all required columns

getType()

Get field type

public static getType(string $field) : string|false
Parameters
$field : string

Name of the field

Return values
string|false

Type of the field or false if not found

initialize()

Add automatic values for fields created_at and updated_at on creation and update

public initialize() : void
Return values
void

returnRelations()

Get all relation by type

public static returnRelations(string $type) : array<string|int, mixed>
Parameters
$type : string

Type of the relation

Return values
array<string|int, mixed>

Relations found

Search results