PHP Class Redaxscript\Db

Since: 2.2.0
Author: Henry Ruhs
Inheritance: extends OR\ORM
Show file Open project: redaxmedia/redaxscript Class Usage Examples

Protected Properties

Property Type Description
$_config object instance of the config class

Public Methods

Method Description
construct ( Config $config ) constructor of the class
countTablePrefix ( ) : Db count table with prefix
findFlatArray ( string $key = 'id' ) : array find a flat array
forTablePrefix ( string $table = null, string $connection = self::DEFAULT_CONNECTION ) : Db for table with prefix
getSetting ( string $key = null ) : mixed get the setting
getStatus ( ) : integer get the database status
init ( ) init the class
leftJoinPrefix ( string $table = null, string $constraint = null, string $tableAlias = null ) : Db left join with prefix
limitGlobal ( ) : Db limit according to global setting
orderGlobal ( string $column = null ) : Db order according to global setting
rawInstance ( ) : Db raw instance helper
setSetting ( string $key = null, string $value = null ) : boolean set the setting
whereLanguageIs ( array $language = null ) : Db where language is
whereLikeMany ( array $columnArray = null, array $likeArray = null ) : Db where like with many

Method Details

construct() public static method

constructor of the class
Since: 2.6.0
public static construct ( Config $config )
$config Config instance of the config class

countTablePrefix() public static method

count table with prefix
Since: 2.4.0
public static countTablePrefix ( ) : Db
return Db

findFlatArray() public method

find a flat array
Since: 3.0.0
public findFlatArray ( string $key = 'id' ) : array
$key string key of the item
return array

forTablePrefix() public static method

for table with prefix
Since: 2.2.0
public static forTablePrefix ( string $table = null, string $connection = self::DEFAULT_CONNECTION ) : Db
$table string name of the table
$connection string which connection to use
return Db

getSetting() public method

get the setting
Since: 3.0.0
public getSetting ( string $key = null ) : mixed
$key string key of the item
return mixed

getStatus() public static method

get the database status
Since: 2.4.0
public static getStatus ( ) : integer
return integer

init() public static method

init the class
Since: 2.6.0
public static init ( )

leftJoinPrefix() public method

left join with prefix
Since: 2.2.0
public leftJoinPrefix ( string $table = null, string $constraint = null, string $tableAlias = null ) : Db
$table string name of the table
$constraint string constraint as needed
$tableAlias string alias of the table
return Db

limitGlobal() public method

limit according to global setting
Since: 2.2.0
public limitGlobal ( ) : Db
return Db

orderGlobal() public method

order according to global setting
Since: 2.2.0
public orderGlobal ( string $column = null ) : Db
$column string name of the column
return Db

rawInstance() public static method

raw instance helper
Since: 2.4.0
public static rawInstance ( ) : Db
return Db

setSetting() public method

set the setting
Since: 3.0.0
public setSetting ( string $key = null, string $value = null ) : boolean
$key string key of the item
$value string value of the item
return boolean

whereLanguageIs() public method

where language is
Since: 3.0.0
public whereLanguageIs ( array $language = null ) : Db
$language array value of the language
return Db

whereLikeMany() public method

where like with many
Since: 3.0.0
public whereLikeMany ( array $columnArray = null, array $likeArray = null ) : Db
$columnArray array array of column names
$likeArray array array of the like
return Db

Property Details

$_config protected static property

instance of the config class
protected static object $_config
return object