FacturaScripts

ModelTrait uses trait:short

Table of Contents

Properties

$extensionCache  : array<string|int, mixed>
Cache for extension lookups by method name.
$extensions  : array<string|int, mixed>
Stores class extensions.
$fields  : array<string|int, mixed>
List of fields in the table.

Methods

__call()  : mixed
Executes the first matched extension.
addExtension()  : void
all()  : array<string|int, static>
Devuelve todos los registros que cumplen las condiciones.
clearExtensions()  : void
Clears all registered extensions.
count()  : int
create()  : static|null
deleteWhere()  : bool
find()  : static|null
findOrCreate()  : static|null
findWhere()  : static|null
findWhereEq()  : static|null
getExtensions()  : array<string|int, mixed>
Returns a list of all registered extension names.
getModelFields()  : array<string|int, mixed>
Returns the list of fields in the table.
hasExtension()  : bool
modelClassName()  : string
Returns the name of the class of the model.
pipe()  : mixed
pipeFalse()  : bool
primaryColumn()  : string
removeExtension()  : bool
Removes all extensions with the specified name.
table()  : DbQuery
tableName()  : string
totalSum()  : float
updateOrCreate()  : static|null
db()  : DataBase
loadModelFields()  : void
buildExtensionCache()  : void
Builds and caches sorted extensions for a method name.

Properties

$extensionCache

Cache for extension lookups by method name.

protected static array<string|int, mixed> $extensionCache = []

$extensions

Stores class extensions.

protected static array<string|int, mixed> $extensions = []

$fields

List of fields in the table.

protected static array<string|int, mixed> $fields = []

Methods

__call()

Executes the first matched extension.

public __call(string $name[, array<string|int, mixed> $arguments = [] ]) : mixed
Parameters
$name : string
$arguments : array<string|int, mixed> = []
Tags
throws
BadMethodCallException

addExtension()

public static addExtension(mixed $extension[, int $priority = 100 ]) : void
Parameters
$extension : mixed
$priority : int = 100

Priority for all methods in this extension (0-1000, default 100)

all()

Devuelve todos los registros que cumplen las condiciones.

public static all([array<string|int, mixed> $where = [] ][, array<string|int, mixed> $order = [] ][, int $offset = 0 ][, int $limit = 0 ]) : array<string|int, static>
Parameters
$where : array<string|int, mixed> = []
$order : array<string|int, mixed> = []
$offset : int = 0
$limit : int = 0
Return values
array<string|int, static>

clearExtensions()

Clears all registered extensions.

public static clearExtensions() : void

count()

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

create()

public static create(array<string|int, mixed> $data) : static|null
Parameters
$data : array<string|int, mixed>
Return values
static|null

deleteWhere()

public static deleteWhere(array<string|int, mixed> $where) : bool
Parameters
$where : array<string|int, mixed>
Return values
bool

find()

public static find(mixed $code) : static|null
Parameters
$code : mixed
Return values
static|null

findOrCreate()

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

findWhere()

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

findWhereEq()

public static findWhereEq(string $field, mixed $value) : static|null
Parameters
$field : string
$value : mixed
Return values
static|null

getExtensions()

Returns a list of all registered extension names.

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

getModelFields()

Returns the list of fields in the table.

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

hasExtension()

public hasExtension(mixed $name) : bool
Parameters
$name : mixed
Return values
bool

modelClassName()

Returns the name of the class of the model.

public modelClassName() : string
Return values
string

pipe()

public pipe(string $name, array<string|int, mixed> ...$arguments) : mixed
Parameters
$name : string
$arguments : array<string|int, mixed>

pipeFalse()

public pipeFalse(string $name, array<string|int, mixed> ...$arguments) : bool
Parameters
$name : string
$arguments : array<string|int, mixed>
Return values
bool

primaryColumn()

public abstract static primaryColumn() : string
Return values
string

removeExtension()

Removes all extensions with the specified name.

public static removeExtension(string $name) : bool
Parameters
$name : string
Return values
bool

True if at least one extension was removed

tableName()

public abstract static tableName() : string
Return values
string

totalSum()

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

updateOrCreate()

public static updateOrCreate(array<string|int, mixed> $where, array<string|int, mixed> $data) : static|null
Parameters
$where : array<string|int, mixed>
$data : array<string|int, mixed>
Return values
static|null

loadModelFields()

protected loadModelFields() : void

buildExtensionCache()

Builds and caches sorted extensions for a method name.

private buildExtensionCache(string $name) : void
Parameters
$name : string

        
On this page

Search results