Class AQueryWriter
RedBeanPHP Abstract Query Writer. Represents an abstract Database to RedBean To write a driver for a different database for RedBean Contains a number of functions all implementors can inherit or override.
Direct known subclasses
RedBeanPHP\QueryWriter\CUBRID, RedBeanPHP\QueryWriter\MySQL, RedBeanPHP\QueryWriter\PostgreSQL, RedBeanPHP\QueryWriter\SQLiteTNamespace: RedBeanPHP\QueryWriter
Copyright:
(c) copyright G.J.G.T. (Gabor) de Mooij and the RedBeanPHP Community. This source file is subject to the BSD/GPLv2 License that is bundled with this source code in the file license.txt.
License: BSD/GPLv2
Author: Gabor de Mooij and the RedBeanPHP Community
File: RedBeanPHP/QueryWriter/AQueryWriter.php
Located at QueryWriter/AQueryWriter.php
public static
boolean
|
|
public static
|
|
public static
|
|
public static
string
|
#
camelsSnake( string $camel )
Globally available service method for RedBeanPHP. Converts a camel cased string to a snake cased string. |
public static
|
|
public static
|
#
setNarrowFieldMode( boolean $narrowField )
Toggles 'Narrow Field Mode'. In Narrow Field mode the queryRecord method will narrow its selection field to |
public static
|
#
setSQLFilters( array $sqlFilters, $safeMode = false )
Sets SQL filters. This is a lowlevel method to set the SQL filter array. The format of this array is: |
public static
array
|
#
getSQLFilters( )
Returns current SQL Filters. This method returns the raw SQL filter array. This is a lowlevel method. For a more friendly method please take a look at the facade: R::bindFunc(). |
protected
array|null
|
#
getForeignKeyForTypeProperty( string $type, string $property )
Given a type and a property name this method returns the foreign key map section associated with this pair. |
protected
array
|
#
getKeyMapForType( string $type )
Returns the foreign key map (FKM) for a type. A foreign key map describes the foreign keys in a table. A FKM always has the same structure: |
protected
string
|
#
makeFKLabel( string $from, string $type, string $to )
This method makes a key for a foreign key description array. This key is a readable string unique for every source table. This uniform key is called the FKDL Foreign Key Description Label. Note that the source table is not part of the FKDL because this key is supposed to be 'per source table'. If you wish to include a source table, prefix the key with 'on_table_ |
protected
string
|
|
protected
string
|
#
getParametersForInClause( array & $valueList, array $otherBindings, integer $offset = 0 )
Generates a list of parameters (slots) for an SQL snippet. This method calculates the correct number of slots to insert in the SQL snippet and determines the correct type of slot. If the bindings array contains named parameters this method will return named ones and update the keys in the value list accordingly (that's why we use the &). |
protected
|
#
addDataType( integer $dataTypeID, string $SQLDefinition )
Adds a data type to the list of data types. Use this method to add a new column type definition to the writer. Used for UUID support. |
protected
string
|
|
protected
boolean
|
#
startsWithZeros( string $value )
Checks whether a value starts with zeros. In this case the value should probably be stored using a text datatype instead of a numerical type in order to preserve the zeros. |
protected
integer
|
#
insertRecord( string $type, array $insertcolumns, array $insertvalues )
Inserts a record into the database using a series of insert columns and corresponding insertvalues. Returns the insert id. |
protected
string
|
|
public
boolean
|
#
tableExists( string $table )
Checks whether the specified type (i.e. table) already exists in the database. Not part of the Object Database interface! |
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
#
setUseCache( boolean $yesNo )
Turns caching on or off. Default: off. If caching is turned on retrieval queries fired after eachother will use a result row cache. |
public
integer
|
#
flushCache( $newMaxCacheSizePerType = NULL )
Flushes the Query Writer Cache. Clears the internal query cache array and returns its overall size. |
public
string
|
|
public
string
|
|
public
|
|
public
|
public static
array
|
$renames
|
#
array()
|
protected
|
$adapter
|
|
protected
string
|
$defaultValue
|
#
'NULL'
|
protected
string
|
$quoteCharacter
|
#
''
|
protected
boolean
|
$flagUseCache
|
#
TRUE
|
protected
array
|
$cache
|
#
array()
|
protected
integer
|
$maxCacheSizePerType
|
#
20
|
public
array
|
$typeno_sqltype
|
#
array()
|