CronJob
extends CronJob
in package
Class created by Core/Internal/PluginsDeploy
Table of Contents
Properties
- $daily_exec : int
- $date : string
- $done : bool
- $duration : float
- $enabled : bool
- $failed : bool
- $fails : int
- $id : int
- $jobname : string
- $last_duration : float
- $pluginname : string
- $running : int
- $attributes : array<string|int, mixed>
- The model's attributes.
- $dataBase : DataBase
- It provides direct access to the database.
- $fields : array<string|int, mixed>
- List of fields in the table.
- $original : array<string|int, mixed>
- The model's original attributes.
Methods
- __construct() : mixed
- __get() : mixed
- __isset() : bool
- __set() : void
- __unset() : void
- addExtension() : void
- all() : array<string|int, static>
- Devuelve todos los registros que cumplen las condiciones.
- changeId() : bool
- changePrimaryColumnValue() : bool
- clear() : void
- clearCache() : void
- clearMocks() : void
- count() : int
- create() : static|null
- delete() : bool
- deleteWhere() : bool
- every() : self
- everyDay() : self
- everyDayAt() : self
- everyFridayAt() : self
- everyLastDayOfMonthAt() : self
- everyMondayAt() : self
- everySaturdayAt() : self
- everySundayAt() : self
- everyThursdayAt() : self
- everyTuesdayAt() : self
- everyWednesdayAt() : self
- everyYearAt() : self
- exists() : bool
- find() : static|null
- findOrCreate() : static|null
- findWhere() : static|null
- findWhereEq() : static|null
- get() : mixed
- getApiFieldsToHide() : array<string|int, string>
- Devuelve los nombres de campos que no deben exponerse en la API (ni en GET, ni en el schema). Los modelos con datos sensibles deben sobrescribir este método.
- getDirty() : array<string|int, mixed>
- Devuelve un array asociativo con los campos modificados y sus valores actuales.
- getModelFields() : array<string|int, mixed>
- Returns the list of fields in the table.
- getOriginal() : mixed|null
- Devuelve el valor original de un campo, si no se indica campo devuelve todo el array original
- hasChanged() : bool
- hasColumn() : bool
- hasExtension() : bool
- id() : mixed
- install() : string
- isDirty() : bool
- Comprueba si los campos del modelo han sido modificados.
- isReady() : bool
- load() : bool
- Carga un modelo dada su primary key
- loadFromCode() : bool
- Carga un registro del modelo utilizando un código y opcionalmente condiciones adicionales.
- loadFromData() : void
- loadWhere() : bool
- Carga el primer registro que coincida con las condiciones especificadas.
- loadWhereEq() : bool
- modelClassName() : string
- Returns the name of the class of the model.
- newCode() : mixed
- pipe() : mixed
- pipeFalse() : bool
- primaryColumn() : string
- primaryColumnValue() : mixed
- primaryDescription() : mixed
- primaryDescriptionColumn() : string
- reload() : bool
- run() : bool
- save() : bool
- Guarda el modelo en la base de datos después de ejecutar las comprobaciones `$this->test()`
- setMockDateTime() : void
- setMockMicrotime() : void
- syncOriginal() : void
- table() : DbQuery
- tableName() : string
- test() : bool
- Realiza pruebas de validación sobre los campos del modelo antes de guardarlo.
- toArray() : array<string|int, mixed>
- Devuelve un array con los campos y valores del modelo.
- totalSum() : float
- update() : bool
- Actualiza el modelo con los valores proporcionados en el array
- updateOrCreate() : static|null
- url() : string
- Genera una URL para el modelo según el tipo especificado.
- withoutOverlapping() : self
- belongsTo() : object|null
- Define una relación uno a uno.
- db() : DataBase
- getCurrentDateTime() : string
- getCurrentMicrotime() : float
- getCurrentTimestamp() : int
- hasMany() : array<string|int, mixed>
- Define a one-to-many relationship.
- loadModelFields() : void
- onChange() : bool
- Este método se llama antes de guardar (insertar) un nuevo registro en la base de datos.
- onDelete() : void
- Este método se llama al eliminar un registro de la base de datos.
- onInsert() : void
- Este método se llama al insertar un nuevo registro en la base de datos (saveInsert).
- onUpdate() : void
- Este método se llama al insertar un nuevo registro en la base de datos (saveUpdate).
- saveInsert() : bool
- saveUpdate() : bool
- Este método se llama al actualizar un registro existente en la base de datos.
Properties
$daily_exec
public
int
$daily_exec
$date
public
string
$date
$done
public
bool
$done
$duration
public
float
$duration
$enabled
public
bool
$enabled
$failed
public
bool
$failed
$fails
public
int
$fails
$id
public
int
$id
$jobname
public
string
$jobname
$last_duration
public
float
$last_duration
$pluginname
public
string
$pluginname
$running
public
int
$running
$attributes
The model's attributes.
protected
array<string|int, mixed>
$attributes
= []
$dataBase
It provides direct access to the database.
protected
static DataBase
$dataBase
$fields
List of fields in the table.
protected
static array<string|int, mixed>
$fields
= []
$original
The model's original attributes.
protected
array<string|int, mixed>
$original
= []
Methods
__construct()
public
__construct([array<string|int, mixed> $data = [] ]) : mixed
Parameters
- $data : array<string|int, mixed> = []
__get()
public
__get(string $key) : mixed
Parameters
- $key : string
__isset()
public
__isset(string $key) : bool
Parameters
- $key : string
Return values
bool__set()
public
__set(string $key, mixed $value) : void
Parameters
- $key : string
- $value : mixed
__unset()
public
__unset(string $key) : void
Parameters
- $key : string
addExtension()
public
abstract static addExtension(mixed $extension[, int $priority = 100 ]) : void
Parameters
- $extension : mixed
- $priority : int = 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>changeId()
public
changeId(mixed $new_id) : bool
Parameters
- $new_id : mixed
Return values
boolchangePrimaryColumnValue()
public
changePrimaryColumnValue(mixed $new_id) : bool
replace with changeId()
Parameters
- $new_id : mixed
Return values
boolclear()
public
clear() : void
clearCache()
public
clearCache() : void
clearMocks()
public
clearMocks() : void
count()
public
static count([array<string|int, mixed> $where = [] ]) : int
Parameters
- $where : array<string|int, mixed> = []
Return values
intcreate()
public
static create(array<string|int, mixed> $data) : static|null
Parameters
- $data : array<string|int, mixed>
Return values
static|nulldelete()
public
delete() : bool
Return values
booldeleteWhere()
public
static deleteWhere(array<string|int, mixed> $where) : bool
Parameters
- $where : array<string|int, mixed>
Return values
boolevery()
public
every(string $period) : self
Parameters
- $period : string
Return values
selfeveryDay()
public
everyDay(int $day, int $hour[, bool $strict = false ]) : self
Parameters
- $day : int
- $hour : int
- $strict : bool = false
Return values
selfeveryDayAt()
public
everyDayAt(int $hour[, bool $strict = false ]) : self
Parameters
- $hour : int
- $strict : bool = false
Return values
selfeveryFridayAt()
public
everyFridayAt(int $hour[, bool $strict = false ]) : self
Parameters
- $hour : int
- $strict : bool = false
Return values
selfeveryLastDayOfMonthAt()
public
everyLastDayOfMonthAt(int $hour[, bool $strict = false ]) : self
Parameters
- $hour : int
- $strict : bool = false
Return values
selfeveryMondayAt()
public
everyMondayAt(int $hour[, bool $strict = false ]) : self
Parameters
- $hour : int
- $strict : bool = false
Return values
selfeverySaturdayAt()
public
everySaturdayAt(int $hour[, bool $strict = false ]) : self
Parameters
- $hour : int
- $strict : bool = false
Return values
selfeverySundayAt()
public
everySundayAt(int $hour[, bool $strict = false ]) : self
Parameters
- $hour : int
- $strict : bool = false
Return values
selfeveryThursdayAt()
public
everyThursdayAt(int $hour[, bool $strict = false ]) : self
Parameters
- $hour : int
- $strict : bool = false
Return values
selfeveryTuesdayAt()
public
everyTuesdayAt(int $hour[, bool $strict = false ]) : self
Parameters
- $hour : int
- $strict : bool = false
Return values
selfeveryWednesdayAt()
public
everyWednesdayAt(int $hour[, bool $strict = false ]) : self
Parameters
- $hour : int
- $strict : bool = false
Return values
selfeveryYearAt()
public
everyYearAt(int $month, int $day, int $hour[, bool $strict = false ]) : self
Parameters
- $month : int
- $day : int
- $hour : int
- $strict : bool = false
Return values
selfexists()
public
exists() : bool
Return values
boolfind()
public
static find(mixed $code) : static|null
Parameters
- $code : mixed
Return values
static|nullfindOrCreate()
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|nullfindWhere()
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|nullfindWhereEq()
public
static findWhereEq(string $field, mixed $value) : static|null
Parameters
- $field : string
- $value : mixed
Return values
static|nullget()
public
get(mixed $code) : mixed
Use find() instead
Parameters
- $code : mixed
getApiFieldsToHide()
Devuelve los nombres de campos que no deben exponerse en la API (ni en GET, ni en el schema). Los modelos con datos sensibles deben sobrescribir este método.
public
getApiFieldsToHide() : array<string|int, string>
Return values
array<string|int, string>getDirty()
Devuelve un array asociativo con los campos modificados y sus valores actuales.
public
getDirty() : 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>getOriginal()
Devuelve el valor original de un campo, si no se indica campo devuelve todo el array original
public
getOriginal([string|null $key = null ]) : mixed|null
Parameters
- $key : string|null = null
Return values
mixed|null —Devuelve el valor original del campo o null si no existe
hasChanged()
public
hasChanged(string $field) : bool
replace with isDirty()
Parameters
- $field : string
Return values
boolhasColumn()
public
hasColumn(string $columnName) : bool
Parameters
- $columnName : string
Return values
boolhasExtension()
public
abstract hasExtension(mixed $extension) : bool
Parameters
- $extension : mixed
Return values
boolid()
public
id() : mixed
install()
public
install() : string
Return values
stringisDirty()
Comprueba si los campos del modelo han sido modificados.
public
isDirty([string|null $key = null ]) : bool
Devuelve true si hay cambios, false en caso contrario.
Si introduces un parámetro key, comprueba solo ese campo
Parameters
- $key : string|null = null
Return values
bool —true si ha sido modificado, false en caso contrario
isReady()
public
isReady() : bool
Return values
boolload()
Carga un modelo dada su primary key
public
load(mixed $code) : bool
Parameters
- $code : mixed
-
Código o identificador del registro a cargar
Return values
bool —Devuelve true si se encontró y cargó un registro exitosamente.
loadFromCode()
Carga un registro del modelo utilizando un código y opcionalmente condiciones adicionales.
public
loadFromCode(mixed $code[, array<string|int, mixed> $where = [] ][, array<string|int, mixed> $order = [] ]) : bool
Usar load() cuando solo se necesita cargar por código, o loadWhere() cuando se requieren condiciones WHERE u ordenamiento adicionales.
IMPORTANTE: Este método está deprecado. Se recomienda usar las alternativas siguientes:
- Si solo se proporciona $code: usar directamente load($code)
- Si se proporciona $code junto con $where o $order: usar loadWhere() con las condiciones apropiadas
Este método actúa como wrapper que redirige a load() cuando solo se proporciona el código, o a loadWhere() cuando se incluyen condiciones WHERE u ordenamiento adicionales.
Parameters
- $code : mixed
-
Código o identificador del registro a cargar. Se usa únicamente cuando no se proporcionan condiciones WHERE adicionales.
- $where : array<string|int, mixed> = []
-
Array de instancias de Where o DatabaseWhere que definen condiciones de filtrado adicionales. Si se proporciona, el método delega a loadWhere(). Por defecto es un array vacío.
- $order : array<string|int, mixed> = []
-
Array asociativo que define el ordenamiento de los resultados. Las claves son nombres de columnas y los valores la dirección del ordenamiento. Por defecto es un array vacío.
Return values
bool —Retorna true si se encontró y cargó un registro exitosamente. Retorna false si no se encontró ningún registro.
loadFromData()
public
loadFromData([array<string|int, mixed> $data = [] ][, array<string|int, mixed> $exclude = [] ][, bool $sync = true ]) : void
Parameters
- $data : array<string|int, mixed> = []
- $exclude : array<string|int, mixed> = []
- $sync : bool = true
loadWhere()
Carga el primer registro que coincida con las condiciones especificadas.
public
loadWhere(array<string|int, mixed> $where[, array<string|int, mixed> $order = [] ]) : bool
Este método consulta la tabla asociada al modelo aplicando las condiciones WHERE proporcionadas y el ordenamiento especificado. Si encuentra un registro, carga sus datos en la instancia actual del modelo. Si no encuentra ningún registro, limpia la instancia y retorna false.
Parameters
- $where : array<string|int, mixed>
-
Array de instancias de Where o DatabaseWhere que definen las condiciones de filtrado para la consulta. Cada elemento representa una condición que debe cumplir el registro a cargar.
- $order : array<string|int, mixed> = []
-
Array asociativo que define el ordenamiento de los resultados. Las claves son nombres de columnas y los valores indican la dirección del ordenamiento (ej: ['id' => 'DESC', 'nombre' => 'ASC']). Por defecto es un array vacío (sin ordenamiento específico).
Return values
bool —Retorna true si se encontró y cargó un registro exitosamente. Retorna false si no se encontró ningún registro que cumpla las condiciones.
loadWhereEq()
public
loadWhereEq(string $field, mixed $value) : bool
Parameters
- $field : string
- $value : mixed
Return values
boolmodelClassName()
Returns the name of the class of the model.
public
modelClassName() : string
Return values
stringnewCode()
public
newCode([string $field = '' ][, array<string|int, mixed> $where = [] ]) : mixed
Parameters
- $field : string = ''
- $where : array<string|int, mixed> = []
pipe()
public
abstract pipe(mixed $name, mixed ...$arguments) : mixed
Parameters
- $name : mixed
- $arguments : mixed
pipeFalse()
public
abstract pipeFalse(mixed $name, mixed ...$arguments) : bool
Parameters
- $name : mixed
- $arguments : mixed
Return values
boolprimaryColumn()
public
abstract static primaryColumn() : string
Return values
stringprimaryColumnValue()
public
primaryColumnValue() : mixed
Use id() instead
Attributes
- #[Deprecated]
- $reason: 'Use id() instead'
- $replacement: '%class%->id()'
primaryDescription()
public
primaryDescription() : mixed
primaryDescriptionColumn()
public
primaryDescriptionColumn() : string
Return values
stringreload()
public
reload() : bool
Return values
boolrun()
public
run(Closure $function) : bool
Parameters
- $function : Closure
Return values
boolsave()
Guarda el modelo en la base de datos después de ejecutar las comprobaciones `$this->test()`
public
save() : bool
Return values
bool —Devuelve true si se ha guardado correctamente, false en caso contrario
setMockDateTime()
public
setMockDateTime(string|null $dateTime[, bool $update_microtime = true ]) : void
Parameters
- $dateTime : string|null
- $update_microtime : bool = true
setMockMicrotime()
public
setMockMicrotime(float|null $microtime) : void
Parameters
- $microtime : float|null
syncOriginal()
public
syncOriginal() : void
table()
public
static table() : DbQuery
Return values
DbQuerytableName()
public
static tableName() : string
Return values
stringtest()
Realiza pruebas de validación sobre los campos del modelo antes de guardarlo.
public
test() : bool
Return values
bool —Devuelve true si todas las pruebas pasan, false en caso contrario
toArray()
Devuelve un array con los campos y valores del modelo.
public
toArray([bool $dynamic_attributes = false ]) : array<string|int, mixed>
Parameters
- $dynamic_attributes : bool = false
-
Si es true, añade también los atributos dinámicos al array resultante
Return values
array<string|int, mixed> —Array asociativo con los campos y valores del modelo
totalSum()
public
static totalSum(string $field[, array<string|int, mixed> $where = [] ]) : float
Parameters
- $field : string
- $where : array<string|int, mixed> = []
Return values
floatupdate()
Actualiza el modelo con los valores proporcionados en el array
public
update(array<string|int, mixed> $values) : bool
Parameters
- $values : array<string|int, mixed>
-
Array asociativo con los campos y valores a actualizar
Return values
bool —Devuelve true si la actualización se ha realizado correctamente, false en caso
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|nullurl()
Genera una URL para el modelo según el tipo especificado.
public
url([string $type = 'auto' ][, string $list = 'ListLogMessage?activetab=List' ]) : string
Parameters
- $type : string = 'auto'
-
Tipo de URL a generar. Puede ser 'auto', 'edit', 'list' o 'new'.
- $list : string = 'ListLogMessage?activetab=List'
-
Nombre de la lista a utilizar en la URL cuando el tipo es 'list' o 'auto'.
Return values
string —URL generada para el modelo
withoutOverlapping()
public
withoutOverlapping(mixed ...$jobs) : self
Parameters
- $jobs : mixed
Return values
selfbelongsTo()
Define una relación uno a uno.
protected
belongsTo(string $modelName, string $foreignKey) : object|null
Parameters
- $modelName : string
- $foreignKey : string
Return values
object|nulldb()
protected
abstract static db() : DataBase
Return values
DataBasegetCurrentDateTime()
protected
getCurrentDateTime([string|null $date = null ]) : string
Parameters
- $date : string|null = null
Return values
stringgetCurrentMicrotime()
protected
getCurrentMicrotime() : float
Return values
floatgetCurrentTimestamp()
protected
getCurrentTimestamp() : int
Return values
inthasMany()
Define a one-to-many relationship.
protected
hasMany(string $modelName, string $foreignKey[, array<string|int, mixed> $where = [] ][, array<string|int, mixed> $order = [] ]) : array<string|int, mixed>
Parameters
- $modelName : string
- $foreignKey : string
- $where : array<string|int, mixed> = []
- $order : array<string|int, mixed> = []
Return values
array<string|int, mixed>loadModelFields()
protected
loadModelFields() : void
onChange()
Este método se llama antes de guardar (insertar) un nuevo registro en la base de datos.
protected
onChange(string $field) : bool
Parameters
- $field : string
Return values
boolonDelete()
Este método se llama al eliminar un registro de la base de datos.
protected
onDelete() : void
onInsert()
Este método se llama al insertar un nuevo registro en la base de datos (saveInsert).
protected
onInsert() : void
onUpdate()
Este método se llama al insertar un nuevo registro en la base de datos (saveUpdate).
protected
onUpdate() : void
saveInsert()
protected
saveInsert() : bool
Return values
boolsaveUpdate()
Este método se llama al actualizar un registro existente en la base de datos.
protected
saveUpdate() : bool
Return values
bool —Devuelve true si la actualización se realizó correctamente, false en caso contrario