class Builder extends Builder

TastyIgniter Database Manager Class

Methods

Collection
lists(string $column, string|null $key = null)

Get an array with the values of a given column.

Collection
dropdown(string $column, string|null $key = null)

Get an array with the values of a given column.

search(string $term, array $columns = [], string $mode = 'all')

Perform a search on this query for term found in columns.

orSearch(string $term, array $columns = [], string $mode = 'all')

Add an "or search where" clause to the query.

like(string $column, $value, string $side = 'both', string $boolean = 'and')

Convenient method for where like clause

orLike(string $column, $value, string $side = 'both')

Convenient method for or where like clause

$this
searchInternal($term, array $columns, $mode, $boolean)

Internal method to apply a search constraint to the query.

likeInternal($column, $value, $side = null, $boolean = 'and')

No description

array
pluckDates(string $column, string $keyFormat = 'Y-m', string $valueFormat = 'F Y')

Get an array with the values of dates.

LengthAwarePaginator
paginate(int $perPage = null, int|null $page = null, array $columns = ['*'], string $pageName = 'page')

Paginate the given query.

Paginator
simplePaginate(int $perPage = null, int|null $page = null, array $columns = ['*'], string $pageName = 'page')

Paginate the given query into a simple paginator.

Model
findOrNew(mixed $id, array $columns = ['*'])

Find a model by its primary key or return fresh model instance with filled attributes to use with forms.

Details

at line 22
Collection lists(string $column, string|null $key = null)

Get an array with the values of a given column.

Parameters

string $column
string|null $key

Return Value

Collection

at line 35
Collection dropdown(string $column, string|null $key = null)

Get an array with the values of a given column.

Parameters

string $column
string|null $key

Return Value

Collection

Perform a search on this query for term found in columns.

Parameters

string $term

Search query

array $columns

Table columns to search

string $mode

Search mode: all, any, exact.

Return Value

Builder

at line 65
Builder orSearch(string $term, array $columns = [], string $mode = 'all')

Add an "or search where" clause to the query.

Parameters

string $term

Search query

array $columns

Table columns to search

string $mode

Search mode: all, any, exact.

Return Value

Builder

at line 80
Builder like(string $column, $value, string $side = 'both', string $boolean = 'and')

Convenient method for where like clause

Parameters

string $column
$value
string $side
string $boolean

Return Value

Builder

at line 94
Builder orLike(string $column, $value, string $side = 'both')

Convenient method for or where like clause

Parameters

string $column
$value
string $side

Return Value

Builder

at line 113
protected $this searchInternal($term, array $columns, $mode, $boolean)

Internal method to apply a search constraint to the query.

Mode can be any of these options:

  • all: result must contain all words
  • any: result can contain any word
  • exact: result must contain the exact phrase

Parameters

$term
array $columns
$mode
$boolean

Return Value

$this

at line 148
protected likeInternal($column, $value, $side = null, $boolean = 'and')

No description

Parameters

$column
$value
$side
$boolean

at line 178
array pluckDates(string $column, string $keyFormat = 'Y-m', string $valueFormat = 'F Y')

Get an array with the values of dates.

Parameters

string $column
string $keyFormat
string $valueFormat

Return Value

array

at line 211
LengthAwarePaginator paginate(int $perPage = null, int|null $page = null, array $columns = ['*'], string $pageName = 'page')

Paginate the given query.

Parameters

int $perPage
int|null $page
array $columns
string $pageName

Return Value

LengthAwarePaginator

Exceptions

InvalidArgumentException

at line 247
Paginator simplePaginate(int $perPage = null, int|null $page = null, array $columns = ['*'], string $pageName = 'page')

Paginate the given query into a simple paginator.

Parameters

int $perPage
int|null $page
array $columns
string $pageName

Return Value

Paginator

at line 282
Model findOrNew(mixed $id, array $columns = ['*'])

Find a model by its primary key or return fresh model instance with filled attributes to use with forms.

Parameters

mixed $id
array $columns

Return Value

Model