Model
- Full name:
\Qubus\Expressive\ActiveRecord\Model
Constants
Constant | Visibility | Type | Value |
---|---|---|---|
DATE_FORMAT | public | 'Y-m-d H:i:s.u' |
Properties
connection
Database connection.
- This property is static.
queryBuilder
Default orm query builder.
tableName
Database table name.
tablePrefix
Database table prefix.
foreignKey
Parent key found in related model.
primaryKey
Primary key of parent model.
incrementing
exists
data
Query result data.
relations
To stored loaded relation.
fillable
Whitelist of attributes that are checked for mass assignment.
guarded
Blacklist of attributes that cannot be mass-assigned.
guardFlag
Flag of whether fillable/guarded attributes should be guarded.
isReadOnly
Sets whether model is read only.
Methods
__construct
Parameters:
Parameter | Type | Description |
---|---|---|
$newData | array |
connection
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$connection | \Qubus\Expressive\Connection |
dbalQuery
query
all
Parameters:
Parameter | Type | Description |
---|---|---|
$columns | string|array |
get
Parameters:
Parameter | Type | Description |
---|---|---|
$columns | string|array |
first
Parameters:
Parameter | Type | Description |
---|---|---|
$columns | string|array |
find
protected find(mixed $id): \Qubus\Expressive\ActiveRecord\Result|\Qubus\Expressive\ActiveRecord\Row|null
Parameters:
Parameter | Type | Description |
---|---|---|
$id | mixed |
pluck
Parameters:
Parameter | Type | Description |
---|---|---|
$field | mixed |
create
protected static create(array $data): bool|static|\Qubus\Expressive\Database|\Qubus\Expressive\QueryBuilder|int
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$data | array |
Throws:
update
Parameters:
Parameter | Type | Description |
---|---|---|
$data | array |
Throws:
save
Throws:
delete
Throws:
getPrimaryKey
getData
Parameters:
Parameter | Type | Description |
---|---|---|
$field | ?string |
setData
Parameters:
Parameter | Type | Description |
---|---|---|
$field | mixed | |
$value | mixed |
toArray
toJson
hasOne
====================================== Relationship Methods ======================================
public hasOne(\Qubus\Expressive\ActiveRecord\Model|string $related, string|int|null $foreignKey = null): \Qubus\Expressive\ActiveRecord\Relations\HasOne
Parameters:
Parameter | Type | Description |
---|---|---|
$related | \Qubus\Expressive\ActiveRecord\Model|string | |
$foreignKey | string|int|null |
hasMany
public hasMany(\Qubus\Expressive\ActiveRecord\Model|string $related, string|int|null $foreignKey = null): \Qubus\Expressive\ActiveRecord\Relations\HasMany
Parameters:
Parameter | Type | Description |
---|---|---|
$related | \Qubus\Expressive\ActiveRecord\Model|string | |
$foreignKey | string|int|null |
belongsTo
public belongsTo(\Qubus\Expressive\ActiveRecord\Model|string $related, string|int|null $foreignKey = null): \Qubus\Expressive\ActiveRecord\Relations\BelongsTo
Parameters:
Parameter | Type | Description |
---|---|---|
$related | \Qubus\Expressive\ActiveRecord\Model|string | |
$foreignKey | string|int|null |
belongsToMany
public belongsToMany(\Qubus\Expressive\ActiveRecord\Model|string $related, ?string $pivotTable = null, string|int|null $foreignKey = null, string|int|null $otherKey = null): \Qubus\Expressive\ActiveRecord\Relations\BelongsToMany
Parameters:
Parameter | Type | Description |
---|---|---|
$related | \Qubus\Expressive\ActiveRecord\Model|string | |
$pivotTable | ?string | |
$foreignKey | string|int|null | |
$otherKey | string|int|null |
setRelation
Parameters:
Parameter | Type | Description |
---|---|---|
$name | mixed | |
$relation | \Qubus\Expressive\ActiveRecord\Relations\Relation |
getRelation
Parameters:
Parameter | Type | Description |
---|---|---|
$name | mixed |
load
Parameters:
Parameter | Type | Description |
---|---|---|
$related | string |
aggregates
Parameters:
Parameter | Type | Description |
---|---|---|
$function | mixed | |
$field | mixed |
max
Parameters:
Parameter | Type | Description |
---|---|---|
$field | mixed |
min
Parameters:
Parameter | Type | Description |
---|---|---|
$field | mixed |
avg
Parameters:
Parameter | Type | Description |
---|---|---|
$field | mixed |
sum
Parameters:
Parameter | Type | Description |
---|---|---|
$field | mixed |
count
Parameters:
Parameter | Type | Description |
---|---|---|
$field | mixed |
setAttributesViaMassAssignment
====================================== Mass assignment protection.
======================================
Parameters:
Parameter | Type | Description |
---|---|---|
$attributes | array|object |
timestamp
Throws:
isReadOnly
Parameters:
Parameter | Type | Description |
---|---|---|
$methodName | string |
Throws:
__call
====================================== Magic Methods ======================================
Parameters:
Parameter | Type | Description |
---|---|---|
$name | mixed | |
$arguments | mixed |
__callStatic
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$name | mixed | |
$arguments | mixed |
__get
Parameters:
Parameter | Type | Description |
---|---|---|
$field | mixed |
__set
Parameters:
Parameter | Type | Description |
---|---|---|
$field | mixed | |
$value | mixed |
__isset
Parameters:
Parameter | Type | Description |
---|---|---|
$field | mixed |
Automatically generated on 2025-10-13