Entity
in package
Uses
HasConfig, HasTable, HasWhere, HasFirst, HasJoin, HasFind, HasLast, HasLike, HasAll, HasNot
The base entity class
Tags
Table of Contents
- $table : string
- $id : int|null
- ID of a record for updating
- __construct() : mixed
- Constructor
- all() : Builder
- config() : Builder
- find() : mixed
- first() : mixed
- join() : mixed
- last() : mixed
- like() : Builder
- save() : bool|int
- Save a record
- table() : string
- Returns a converted database table name
- where() : mixed
- whereNot() : mixed
Properties
$table
protected
static string
$table
Database table
$id
ID of a record for updating
private
int|null
$id
Methods
__construct()
Constructor
public
__construct([int $id = null ]) : mixed
Parameters
- $id : int = null
-
Pass an ID to update a record
Return values
mixed —all()
public
static all([string $columns = '*' ]) : Builder
Parameters
- $columns : string = '*'
Return values
Builder —config()
public
static config([string $config = null ]) : Builder
Parameters
- $config : string = null
Return values
Builder —find()
public
static find(int $id[, string $columns = '*' ]) : mixed
Parameters
- $id : int
- $columns : string = '*'
Return values
mixed —first()
public
static first([string $columns = '*' ]) : mixed
Parameters
- $columns : string = '*'
Return values
mixed —join()
public
static join(string $table, array<string|int, mixed> $on[, string $columns = '*' ]) : mixed
Parameters
- $table : string
- $on : array<string|int, mixed>
- $columns : string = '*'
Return values
mixed —last()
public
static last([string $columns = '*' ]) : mixed
Parameters
- $columns : string = '*'
Return values
mixed —like()
public
static like(string $field, string $pattern[, string $columns = '*' ]) : Builder
Parameters
- $field : string
- $pattern : string
- $columns : string = '*'
Return values
Builder —save()
Save a record
public
save() : bool|int
Return values
bool|int —table()
Returns a converted database table name
public
static table() : string
Return values
string —where()
public
static where(mixed $key[, mixed $is = null ][, mixed $value = null ][, string $columns = '*' ]) : mixed
Parameters
- $key : mixed
- $is : mixed = null
- $value : mixed = null
- $columns : string = '*'
Return values
mixed —whereNot()
public
static whereNot([mixed $key = null ][, mixed $value = null ][, string $columns = '*' ]) : mixed
Parameters
- $key : mixed = null
- $value : mixed = null
- $columns : string = '*'