Свойство | Тип | Описание | |
---|---|---|---|
$renames | array | ||
$typeno_sqltype | array |
Свойство | Тип | Описание | |
---|---|---|---|
$adapter | |||
$cache | array | ||
$defaultValue | string | ||
$flagUseCache | boolean | ||
$maxCacheSizePerType | integer | ||
$quoteCharacter | string |
Метод | Описание | |
---|---|---|
addColumn ( $type, $column, $field ) | ||
addUniqueIndex ( $type, $properties ) | ||
camelsSnake ( string $camel ) : string | Globally available service method for RedBeanPHP. | |
canBeTreatedAsInt ( string $value ) : boolean | Checks whether a number can be treated like an int. | |
clearRenames ( ) : void | Clears renames. | |
deleteRecord ( $type, $conditions = [], $addSql = NULL, $bindings = [] ) | ||
deleteRelations ( $sourceType, $destType, $sourceID ) | ||
esc ( $dbStructure, $dontQuote = FALSE ) | ||
flushCache ( $newMaxCacheSizePerType = NULL ) : integer | Flushes the Query Writer Cache. | |
getAssocTable ( $types ) | ||
getAssocTableFormat ( $types ) | ||
getSQLFilters ( ) : array | Returns current SQL Filters. | |
glueLimitOne ( $sql = '' ) | ||
glueSQLCondition ( $sql, $glue = NULL ) | ||
inferFetchType ( $type, $property ) | ||
queryRecord ( $type, $conditions = [], $addSql = NULL, $bindings = [] ) | ||
queryRecordCount ( $type, $conditions = [], $addSql = NULL, $bindings = [] ) | ||
queryRecordCountRelated ( $sourceType, $destType, $linkID, $addSql = '', $bindings = [] ) | ||
queryRecordLink ( $sourceType, $destType, $sourceID, $destID ) | ||
queryRecordRelated ( $sourceType, $destType, $linkIDs, $addSql = '', $bindings = [] ) | ||
queryRecordWithCursor ( $type, $addSql = NULL, $bindings = [] ) | ||
queryTagged ( $type, $tagList, $all = FALSE, $addSql = '', $bindings = [] ) | ||
renameAssocTable ( $from, $to = NULL ) | ||
renameAssociation ( $from, $to = NULL ) | ||
safeColumn ( string $column, boolean $noQuotes = FALSE ) : string | ||
safeTable ( string $table, boolean $noQuotes = FALSE ) : string | ||
setNarrowFieldMode ( boolean $narrowField ) : void | Toggles 'Narrow Field Mode'. | |
setSQLFilters ( $sqlFilters, $safeMode = false ) : void | Sets SQL filters. | |
setUseCache ( $yesNo ) : void | Turns caching on or off. Default: off. | |
tableExists ( string $table ) : boolean | Checks whether the specified type (i.e. table) already exists in the database. | |
updateRecord ( $type, $updatevalues, $id = NULL ) | ||
widenColumn ( $type, $property, $dataType ) | ||
wipe ( $type ) | ||
writeJoin ( $type, $targetType, $leftRight = 'LEFT' ) |
Метод | Описание | |
---|---|---|
addDataType ( integer $dataTypeID, string $SQLDefinition ) : self | Adds a data type to the list of data types. | |
check ( $struct ) : string | Checks table name or column name. | |
getForeignKeyForTypeProperty ( string $type, string $property ) : array | null | Given a type and a property name this method returns the foreign key map section associated with this pair. | |
getInsertSuffix ( string $table ) : string | Returns the sql that should follow an insert statement. | |
getKeyMapForType ( string $type ) : array | Returns the foreign key map (FKM) for a type. | |
getParametersForInClause ( &$valueList, array $otherBindings, integer $offset ) : string | Generates a list of parameters (slots) for an SQL snippet. | |
getSQLFilterSnippet ( string $type ) : string | Returns an SQL Filter snippet for reading. | |
insertRecord ( $type, array $insertcolumns, array $insertvalues ) : integer | Inserts a record into the database using a series of insert columns and corresponding insertvalues. Returns the insert id. | |
makeFKLabel ( string $from, string $type, string $to ) : string | This method makes a key for a foreign key description array. | |
startsWithZeros ( string $value ) : boolean | 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. |
Метод | Описание | |
---|---|---|
getCacheKey ( array $keyValues ) : string | Returns a cache key for the cache values passed. | |
getCached ( string $cacheTag, string $key ) : mixed | Returns the values associated with the provided cache tag and key. | |
getRelationalTablesAndColumns ( string $sourceType, string $destType, boolean $noQuote = FALSE ) : array | Returns the table names and column names for a relational query. | |
makeSQLFromConditions ( array $conditions, array &$bindings, string $addSql = '' ) : string | Creates an SQL snippet from a list of conditions of format: | |
putResultInCache ( string $cacheTag, string $key, array $values ) : void | Stores data from the writer in the cache under a specific key and cache tag. | |
updateCache ( ) : boolean | Checks if the previous query had a keep-cache tag. |
protected addDataType ( integer $dataTypeID, string $SQLDefinition ) : self | ||
$dataTypeID | integer | magic number constant assigned to this data type |
$SQLDefinition | string | SQL column definition (i.e. INT(11)) |
Результат | self |
public static camelsSnake ( string $camel ) : string | ||
$camel | string | camelCased string to converty to snake case |
Результат | string |
public static canBeTreatedAsInt ( string $value ) : boolean | ||
$value | string | string representation of a certain value |
Результат | boolean |
public static clearRenames ( ) : void | ||
Результат | void |
public deleteRecord ( $type, $conditions = [], $addSql = NULL, $bindings = [] ) |
public flushCache ( $newMaxCacheSizePerType = NULL ) : integer | ||
Результат | integer |
protected getInsertSuffix ( string $table ) : string | ||
$table | string | name |
Результат | string |
array(
'name' =>
'from' =>
'table' =>
'to' => (most of the time 'id')
'on_update' =>
'on_delete' =>
)
protected getKeyMapForType ( string $type ) : array | ||
$type | string | the bean type you wish to obtain a key map of |
Результат | array |
protected getSQLFilterSnippet ( string $type ) : string | ||
$type | string | type of bean |
Результат | string |
public static getSQLFilters ( ) : array | ||
Результат | array |
public queryRecord ( $type, $conditions = [], $addSql = NULL, $bindings = [] ) |
public queryRecordCount ( $type, $conditions = [], $addSql = NULL, $bindings = [] ) |
public queryRecordCountRelated ( $sourceType, $destType, $linkID, $addSql = '', $bindings = [] ) |
public queryRecordLink ( $sourceType, $destType, $sourceID, $destID ) |
public queryRecordRelated ( $sourceType, $destType, $linkIDs, $addSql = '', $bindings = [] ) |
public queryRecordWithCursor ( $type, $addSql = NULL, $bindings = [] ) |
public queryTagged ( $type, $tagList, $all = FALSE, $addSql = '', $bindings = [] ) |
public static renameAssociation ( $from, $to = NULL ) |
public static setNarrowFieldMode ( boolean $narrowField ) : void | ||
$narrowField | boolean | TRUE = Narrow Field FALSE = Wide Field |
Результат | void |
array(
'' => array(
'' => array(
'' => ''
)
)
)
Example:
array(
QueryWriter::C_SQLFILTER_READ => array(
'book' => array(
'title' => ' LOWER(book.title) '
)
)
Note that you can use constants instead of magical chars
as keys for the uppermost array.
This is a lowlevel method. For a more friendly method
please take a look at the facade: R::bindFunc().
public static setSQLFilters ( $sqlFilters, $safeMode = false ) : void
Результат
void
If caching is turned on retrieval queries fired after eachother will
use a result row cache.
public setUseCache ( $yesNo ) : void
Результат
void
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 startsWithZeros ( string $value ) : boolean
$value
string
value to be checked.
Результат
boolean
Not part of the Object Database interface!
public tableExists ( string $table ) : boolean
$table
string
table name
Результат
boolean
Описание свойств
protected DBAdapter,RedBeanPHP\Adapter $adapter
Результат
RedBeanPHP\Adapter\DBAdapter