class Model

Database Model Factory

Methods

static mixed
seed(string $className, string|null $extensionName, Closure|null $callback = null)

Db seed

static object|null
create(string $className, string|null $extensionName = null, Closure|null $callback = null, bool $showError = true)

Create db model instance

static bool
hasAttribute($model, string $name)

Return true if attribute exist

static string
getSql(Builder $builder)

Get sql

static mixed
getConstant(string $className, string $constantName, string|null $extensionName = null)

Get model constant

static object|null
__callStatic(string $name, array $args)

Create model

static bool
isValidModel(object $instance)

Return true if instance is valid model class

Details

at line 38
static mixed seed(string $className, string|null $extensionName, Closure|null $callback = null)

Db seed

Parameters

string $className
string|null $extensionName
Closure|null $callback

Return Value

mixed

at line 62
static object|null create(string $className, string|null $extensionName = null, Closure|null $callback = null, bool $showError = true)

Create db model instance

Parameters

string $className Base model class name
string|null $extensionName
Closure|null $callback
bool $showError

Return Value

object|null

Exceptions

Exception

at line 90
static bool hasAttribute($model, string $name)

Return true if attribute exist

Parameters

$model
string $name

Return Value

bool

at line 101
static string getSql(Builder $builder)

Get sql

Parameters

Builder $builder

Return Value

string

at line 116
static mixed getConstant(string $className, string $constantName, string|null $extensionName = null)

Get model constant

Parameters

string $className
string $constantName
string|null $extensionName

Return Value

mixed

at line 130
static object|null __callStatic(string $name, array $args)

Create model

Parameters

string $name
array $args

Return Value

object|null

at line 141
static bool isValidModel(object $instance)

Return true if instance is valid model class

Parameters

object $instance

Return Value

bool