common.php

Query

Free Query Builder / Database Abstraction Layer

Functions

do_include()

do_include(string $path) : void

Bulk directory loading workaround for use with array_map and glob

Parameters

string $path

mb_trim()

mb_trim(string $string) : string

Multibyte-safe trim function

Parameters

string $string

Returns

string

db_filter()

db_filter(array $array, mixed $index) : array

Filter out db rows into one array

Parameters

array $array
mixed $index

Returns

array

from_camel_case()

from_camel_case(string $input) : string

Create a snake_case string from camelCase

Parameters

string $input

Returns

string

array_zipper()

array_zipper(array $zipper_input) : array

Zip a set of arrays together on common keys

The $zipper_input array is an array of arrays indexed by their place in the output array.

Parameters

array $zipper_input

Returns

array

array_pluck()

array_pluck(array $array, string $key) : array

Get an array out of an multi-dimensional array based on a common key

Parameters

array $array
string $key

Returns

array

regex_in_array()

regex_in_array(array $array, string $pattern) : bool

Determine whether a value in the passed array matches the pattern passed

Parameters

array $array
string $pattern

Returns

bool

Query()

Query(string|object|array $params) : \Query\Query_Builder|null

Connection function

Send an array or object as connection parameters to create a connection. If the array or object has an 'alias' parameter, passing that string to this function will return that connection. Passing no parameters returns the last connection created.

Parameters

string|object|array $params

Returns

\Query\Query_Builder|null