Documentation

ModelAbstract

Table of Contents

$hasPositionField  : bool
$config  : object
$query  : PixieExtended
$cloneMark  : string
__construct()  : mixed
Constructor
changeRecordPosition()  : mixed
Moves record up/down
clone()  : array<string|int, mixed>
Cloines one or more records record
createUploadsTable()  : mixed
Creates the uploads table
delete()  : mixed
Deletes a record by primary key value and/or other where conditions
extractLocales()  : mixed
Process locales into a recordset
first()  : mixed
Gets a record
formatDate()  : mixed
turns a date from the locale format to YYYY-MM-DD
formatDateTime()  : mixed
turns a datetime from the locale format to YYYY-MM-DD
get()  : mixed
Gets a recordset
getConfig()  : object
Returns the config object
getNextPosition()  : mixed
Gets next free position
getOutputFilePath()  : string
Gets an uploaded file absolute path for an output
getOutputFolder()  : string
Gets an output folder
getPublicOutputFilePath()  : string
Gets an uploaded file path to be used into templates
getQuery()  : PixieExtended
Returns the query instance
getUploadFolder()  : string
Gets an upload folder
getUploadKeyOutputs()  : array<string|int, mixed>
Returns the configured outputs names for an upload key
getUploadKeys()  : array<string|int, mixed>
Returns the configured upload keys names
getUploadsFolder()  : string
Gets the uploads folder
handleException()  : object
Handles an exception using error codes (see https://docstore.mik.ua/orelly/java-ent/jenut/ch08_06.htm)
hasLocales()  : bool
Returns whether the model has at least one localized field
hasUploads()  : bool
Returns whether the model has at least one upload
insert()  : mixed
Inserts a record
localesTable()  : mixed
Builds locales table name
rawField()  : mixed
Builds a raw field
resetAutoIncrement()  : mixed
Resets auto increment
saveLocales()  : mixed
Saves locales values
saveUploadFiles()  : mixed
Saves uploads values
saveUploadsFiles()  : mixed
Saves uploads values
sql()  : string
Ouputs last sql
table()  : string
Returns the table defined
update()  : mixed
Updates a record
view()  : string
Returns the defined view or at least table
deleteUploadedFiles()  : mixed
Delete uploads records
getUploadedFiles()  : array<string|int, mixed>
Gets uploads records
getUploadedFilesNames()  : array<string|int, mixed>
Gets record uploaded files names
unlinkUploadedFiles()  : mixed
Saves uploads values
uploadTable()  : string
Gets the uploads table name
loadConfig()  : mixed
Loads and check config

Properties

Methods

changeRecordPosition()

Moves record up/down

public changeRecordPosition(mixed $primaryKeyValue, mixed $direction) : mixed
Parameters
$primaryKeyValue : mixed
$direction : mixed
Return values
mixed

clone()

Cloines one or more records record

public clone(mixed $primaryKeyValues, array<string|int, mixed> $fieldsToMark[, array<string|int, mixed> $fieldsToUpdate = [] ]) : array<string|int, mixed>
Parameters
$primaryKeyValues : mixed
$fieldsToMark : array<string|int, mixed>
$fieldsToUpdate : array<string|int, mixed> = []
Return values
array<string|int, mixed>

with primaryt keys of cloned records

createUploadsTable()

Creates the uploads table

public createUploadsTable() : mixed
Return values
mixed

delete()

Deletes a record by primary key value and/or other where conditions

public delete([mixed $primaryKeyValue = null ][, mixed $where = [] ]) : mixed
Parameters
$primaryKeyValue : mixed = null
$where : mixed = []
Return values
mixed

extractLocales()

Process locales into a recordset

public extractLocales(array<string|int, mixed> $records) : mixed
Parameters
$records : array<string|int, mixed>
Return values
mixed

first()

Gets a record

public first([array<string|int, mixed> $where = [] ]) : mixed
Parameters
$where : array<string|int, mixed> = []
Return values
mixed

formatDate()

turns a date from the locale format to YYYY-MM-DD

public formatDate(string $fromFormat, string $date) : mixed
Parameters
$fromFormat : string
$date : string
Return values
mixed

formatDateTime()

turns a datetime from the locale format to YYYY-MM-DD

public formatDateTime(string $fromFormat, string $datetime) : mixed
Parameters
$fromFormat : string
$datetime : string
Return values
mixed

get()

Gets a recordset

public get([array<string|int, mixed> $where = [] ][, array<string|int, mixed> $order = [] ]) : mixed
Parameters
$where : array<string|int, mixed> = []
$order : array<string|int, mixed> = []
Return values
mixed

getConfig()

Returns the config object

public getConfig() : object
Return values
object

getNextPosition()

Gets next free position

public getNextPosition([array<string|int, mixed> $contextFieldsValues = [] ]) : mixed
Parameters
$contextFieldsValues : array<string|int, mixed> = []

indexed by field names to narrow context in which to llok for next position

Return values
mixed

getOutputFilePath()

Gets an uploaded file absolute path for an output

public getOutputFilePath(string $uploadKey, string $outputKey, string $fileName) : string
Parameters
$uploadKey : string
$outputKey : string
$fileName : string
Return values
string

getOutputFolder()

Gets an output folder

public getOutputFolder(string $uploadKey, string $outputKey) : string
Parameters
$uploadKey : string
$outputKey : string
Return values
string

getPublicOutputFilePath()

Gets an uploaded file path to be used into templates

public getPublicOutputFilePath(string $uploadKey, string $outputKey, string $fileName) : string
Parameters
$uploadKey : string
$outputKey : string
$fileName : string
Return values
string

getUploadFolder()

Gets an upload folder

public getUploadFolder(string $uploadKey) : string
Parameters
$uploadKey : string
Return values
string

getUploadKeyOutputs()

Returns the configured outputs names for an upload key

public getUploadKeyOutputs(string $uploadKey) : array<string|int, mixed>
Parameters
$uploadKey : string
Return values
array<string|int, mixed>

getUploadKeys()

Returns the configured upload keys names

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

getUploadsFolder()

Gets the uploads folder

public getUploadsFolder() : string
Return values
string

handleException()

Handles an exception using error codes (see https://docstore.mik.ua/orelly/java-ent/jenut/ch08_06.htm)

public handleException(PDOException $exception) : object
Parameters
$exception : PDOException
Return values
object

to be used for alert display with the following properties: ->code: alphanumeric message code ->data: an array with any specific error code relevant data (such as involved field names)

hasLocales()

Returns whether the model has at least one localized field

public hasLocales() : bool
Return values
bool

hasUploads()

Returns whether the model has at least one upload

public hasUploads() : bool
Return values
bool

insert()

Inserts a record

public insert(array<string|int, mixed> &$fieldsValues) : mixed
Parameters
$fieldsValues : array<string|int, mixed>
Return values
mixed

primary key of inserted records or array in case of batch insert

localesTable()

Builds locales table name

public localesTable() : mixed
Return values
mixed

rawField()

Builds a raw field

public rawField(string $sql) : mixed
Parameters
$sql : string
Return values
mixed

resetAutoIncrement()

Resets auto increment

public resetAutoIncrement() : mixed
Return values
mixed

saveLocales()

Saves locales values

public saveLocales(mixed $primaryKeyValue, mixed $localesValues) : mixed
Parameters
$primaryKeyValue : mixed
$localesValues : mixed
Return values
mixed

saveUploadFiles()

Saves uploads values

public saveUploadFiles(mixed $primaryKeyValue, string $uploadKey[, array<string|int, mixed> $filesList = null ]) : mixed
Parameters
$primaryKeyValue : mixed
$uploadKey : string
$filesList : array<string|int, mixed> = null
Return values
mixed

saveUploadsFiles()

Saves uploads values

public saveUploadsFiles(mixed $primaryKeyValue, object $uploadsValues) : mixed
Parameters
$primaryKeyValue : mixed
$uploadsValues : object
Return values
mixed

sql()

Ouputs last sql

public sql() : string
Return values
string

table()

Returns the table defined

public table() : string
Return values
string

update()

Updates a record

public update([mixed $primaryKeyValue = null ][, array<string|int, mixed> &$fieldsValues = [] ]) : mixed
Parameters
$primaryKeyValue : mixed = null
$fieldsValues : array<string|int, mixed> = []
Return values
mixed

view()

Returns the defined view or at least table

public view() : string
Return values
string

deleteUploadedFiles()

Delete uploads records

protected deleteUploadedFiles(mixed $primaryKeyValue[, mixed $uploadKey = null ]) : mixed
Parameters
$primaryKeyValue : mixed
$uploadKey : mixed = null
Return values
mixed

getUploadedFiles()

Gets uploads records

protected getUploadedFiles(mixed $where) : array<string|int, mixed>
Parameters
$where : mixed
Return values
array<string|int, mixed>

getUploadedFilesNames()

Gets record uploaded files names

protected getUploadedFilesNames(mixed $primaryKeyValue[, string $uploadKey = null ]) : array<string|int, mixed>
Parameters
$primaryKeyValue : mixed
$uploadKey : string = null
Return values
array<string|int, mixed>

unlinkUploadedFiles()

Saves uploads values

protected unlinkUploadedFiles(string $uploadKey, array<string|int, mixed> $uploadedFilesToDelete) : mixed
Parameters
$uploadKey : string
$uploadedFilesToDelete : array<string|int, mixed>
Return values
mixed

uploadTable()

Gets the uploads table name

protected uploadTable() : string
Return values
string

loadConfig()

Loads and check config

private loadConfig() : mixed
Return values
mixed

Search results