$connection
$connection : \Omega\Database\Adapter\DatabaseAdapterInterface
Current database instance.
Abstract model class.
The AbstractModel
class providing the base for model class.
$connection : \Omega\Database\Adapter\DatabaseAdapterInterface
Current database instance.
__callStatic(string $method, array $parameters = []) : $this|mixed
Magic method to forward undefined method calls to the underlying query builder instance.
This method allows dynamic method calls on the ModelCollector, delegating them to the underlying query builder instance. This is particularly useful for building queries fluently.
string | $method | Holds the method name. |
array | $parameters | Holds the method parameters. |
if the tabl is not set or getTable is not defined.
Return $this if the method is fluent, otherwise, returns the method result.
hasOne(string $class, string $foreignKey, string $primaryKey = 'id') : \Omega\Database\Relationship
Define a "hasOne" relationship between models.
string | $class | Holds the name of the related model class. |
string | $foreignKey | Holds the foreign key in the current model. |
string | $primaryKey | Holds the primary key in the related model. |
Return the current instance of relation.
hasMany(string $class, string $foreignKey, string $primaryKey = 'id') : \Omega\Database\Relationship
Define a "hasNay" relationship between models.
string | $class | Holds the name of the related model class. |
string | $foreignKey | Holds the foreign key in the current model. |
string | $primaryKey | Holds the primary key in the related model. |
Return the current instance of relation.
belongsTo(string $class, string $foreignKey, string $primaryKey = 'id') : \Omega\Database\Relationship
Define a "belongsTo" relationship between models.
string | $class | Holds the name of the related model class. |
string | $foreignKey | Holds the foreign key in the current model. |
string | $primaryKey | Holds the primary key in the related model. |
Return the current instance of relation.