Méthode |
Description |
|
__callStatic ( string $pluginName, array $params ) : mixed |
Call static for use with dynamic plugins. This magic method will
intercept static calls and route them to the specified plugin. |
|
addDatabase ( string $key, string $dsn, string $user = NULL, null | string $pass = NULL, boolean $frozen = FALSE ) : void |
Adds a database to the facade, afterwards you can select the database using
selectDatabase($key), where $key is the name you assigned to this database. |
|
addTags ( OODBBean $bean, array $tagList ) : void |
Part of RedBeanPHP Tagging API. |
|
aliases ( array $list ) : void |
Sets global aliases. |
|
batch ( string $type, array $ids ) : array |
Returns an array of beans. Pass a type and a series of ids and
this method will bring you the corresponding beans. |
|
beansToArray ( array $beans ) : array |
Little helper method for Resty Bean Can server and others. |
|
begin ( ) : boolean |
Facade Convience method for adapter transaction system. |
|
bindFunc ( string $mode, string $field, string $function ) : void |
Binds an SQL function to a column. |
|
close ( ) : void |
Closes the database connection. |
|
commit ( ) : boolean |
Facade Convience method for adapter transaction system. |
|
configureFacadeWithToolbox ( ToolBox $tb ) : ToolBox |
Configures the facade, want to have a new Writer? A new Object Database or a new
Adapter and you want it on-the-fly? Use this method to hot-swap your facade with a new
toolbox. |
|
convertToBean ( string $type, array $row, $metamask = NULL ) : array |
Just like converToBeans, but for one bean. |
|
convertToBeans ( string $type, array $rows, $metamask = NULL ) : array |
Converts a series of rows to beans. |
|
count ( string $type, string $addSQL = '', array $bindings = [] ) : integer |
Counts the number of beans of type $type. |
|
debug ( boolean $tf = TRUE, integer $mode ) : RDefault |
Toggles DEBUG mode. |
|
dispense ( string | array $typeOrBeanArray, $num = 1, boolean $alwaysReturnArray = FALSE ) : array | OODBBean |
Dispenses a new RedBean OODB Bean for use with
the rest of the methods. |
|
dispenseAll ( string $order, boolean $onlyArrays = FALSE ) : array |
Takes a comma separated list of bean types
and dispenses these beans. For each type in the list
you can specify the number of beans to be dispensed. |
|
dispenseLabels ( string $type, array $labels ) : array |
A label is a bean with only an id, type and name property. |
|
dump ( OODBBean | array $data ) : array |
Simple but effective debug function. |
|
dup ( OODBBean $bean, array $trail = [], boolean $pid = FALSE, $filters = [] ) : array |
Makes a copy of a bean. This method makes a deep copy
of the bean.The copy will have the following features. |
|
duplicate ( OODBBean $bean, $filters = [] ) : array |
Makes a deep copy of a bean. This method makes a deep copy
of the bean.The copy will have the following: |
|
enum ( string $enum ) : array | OODBBean |
Generates and returns an ENUM value. This is how RedBeanPHP handles ENUMs. |
|
exec ( string $sql, array $bindings = [] ) : integer |
Convenience function to execute Queries directly. |
|
exportAll ( array | OODBBean $beans, boolean $parents = FALSE, array $filters = [] ) : array |
Exports a collection of beans. Handy for XML/JSON exports with a
Javascript framework like Dojo or ExtJS. |
|
ext ( string $pluginName, callable $callable ) : void |
Dynamically extends the facade with a plugin. |
|
fancyDebug ( boolean $toggle = TRUE ) : void |
Turns on the fancy debugger. |
|
find ( string $type, string $sql = NULL, array $bindings = [] ) : array |
Finds a bean using a type and a where clause (SQL). |
|
findAll ( string $type, string $sql = NULL, array $bindings = [] ) : array |
|
|
findAndExport ( string $type, string $sql = NULL, array $bindings = [] ) : array |
|
|
findCollection ( string $type, string $sql = NULL, array $bindings = [] ) : redbeanphp\BeanCollection |
Finds a bean collection. |
|
findLast ( string $type, string $sql = NULL, array $bindings = [] ) : OODBBean |
|
|
findLike ( string $type, array $like = [], string $sql = '' ) : array |
Tries to find beans matching the specified type and
criteria set. |
|
findMulti ( array | string $types, $sql, array $bindings = [], array $remappings = [] ) : array |
Finds multiple types of beans at once and offers additional
remapping functionality. This is a very powerful yet complex function. |
|
findOne ( string $type, string $sql = NULL, array $bindings = [] ) : OODBBean |
|
|
findOneOrDispense ( string $type, string $sql = NULL, array $bindings = [] ) : OODBBean |
Same as findOrDispense but returns just one element. |
|
findOrCreate ( string $type, array $like = [] ) : OODBBean |
Tries to find a bean matching a certain type and
criteria set. If no beans are found a new bean
will be created, the criteria will be imported into this
bean and the bean will be stored and returned. |
|
findOrDispense ( string $type, string $sql = NULL, array $bindings = [] ) : array |
Convience method. Tries to find beans of a certain type,
if no beans are found, it dispenses a bean of that type. |
|
flat ( array $array, $result = [] ) : array |
Flattens a multi dimensional bindings array for use with genSlots(). |
|
freeze ( $tf = TRUE ) |
Toggles fluid or frozen mode. In fluid mode the database
structure is adjusted to accomodate your objects. In frozen mode
this is not the case. |
|
gatherLabels ( array $beans ) : array |
Gathers labels from beans. This function loops through the beans,
collects the values of the name properties of each individual bean
and stores the names in a new array. The array then gets sorted using the
default sort function of PHP (sort). |
|
genSlots ( array $array, $template = NULL ) : string |
Generates question mark slots for an array of values. |
|
getAll ( string $sql, array $bindings = [] ) : array |
Convenience function to execute Queries directly. |
|
getAssoc ( string $sql, array $bindings = [] ) : array |
Convenience function to execute Queries directly. |
|
getAssocRow ( string $sql, array $bindings = [] ) : array |
Convenience function to execute Queries directly. |
|
getCell ( string $sql, array $bindings = [] ) : string |
Convenience function to execute Queries directly. |
|
getCol ( string $sql, array $bindings = [] ) : array |
Convenience function to execute Queries directly. |
|
getColumns ( string $table ) : array |
Returns a list of columns. Format of this array:
array( fieldname => type )
Note that this method only works in fluid mode because it might be
quite heavy on production servers! |
|
getDatabaseAdapter ( ) : DBAdapter |
Optional accessor for neat code. |
|
getDuplicationManager ( ) : DuplicationManager |
Returns the current duplication manager instance. |
|
getExtractedToolbox ( ) : array |
Mostly for internal use, but might be handy
for some users. |
|
getInsertID ( ) : mixed |
Returns the insert ID for databases that support/require this
functionality. Alias for R::getAdapter()->getInsertID(). |
|
getLogger ( ) : RedBeanPHP\Logger |
Returns the current logger instance being used by the
database object. |
|
getLogs ( ) : array |
Returns the log entries written after the startLogging. |
|
getPDO ( ) : null | PDO |
In case you use PDO (which is recommended and the default but not mandatory, hence
the database adapter), you can use this method to obtain the PDO object directly. |
|
getQueryCount ( ) : integer |
Returns the number of SQL queries processed. |
|
getRedBean ( ) : OODB |
Optional accessor for neat code. |
|
getRow ( string $sql, array $bindings = [] ) : array |
Convenience function to execute Queries directly. |
|
getToolBox ( ) : ToolBox |
Returns the toolbox currently used by the facade. |
|
getVersion ( ) : string |
Returns the RedBeanPHP version string. |
|
getWriter ( ) : RedBeanPHP\QueryWriter |
Optional accessor for neat code. |
|
hasDatabase ( string $key ) : boolean |
Determines whether a database identified with the specified key has
already been added to the facade. This function will return TRUE
if the database indicated by the key is available and FALSE otherwise. |
|
hasTag ( OODBBean $bean, array $tags, boolean $all = FALSE ) : boolean |
Part of RedBeanPHP Tagging API. |
|
inspect ( string $type = NULL ) : array |
Inspects the database schema. If you pass the type of a bean this
method will return the fields of its table in the database. |
|
isoDate ( mixed $time = NULL ) : string |
Simple convenience function, returns ISO date formatted representation
of $time. |
|
isoDateTime ( mixed $time = NULL ) : string |
Simple convenience function, returns ISO date time
formatted representation
of $time. |
|
load ( string $type, integer $id ) : OODBBean |
Loads a bean from the object database. |
|
loadAll ( string $type, array $ids ) : array |
|
|
loadMulti ( string | array $types, mixed $id ) : OODBBean |
Loads multiple types of beans with the same ID. |
|
nuke ( ) : void |
Nukes the entire database. |
|
renameAssociation ( string | array $from, string $to = NULL ) : void |
Facade method for AQueryWriter::renameAssociation() |
|
resetQueryCount ( ) : integer |
Resets the Query counter. |
|
rollback ( ) : boolean |
Facade Convience method for adapter transaction system. |
|
selectDatabase ( string $key ) : boolean |
Selects a different database for the Facade to work with. |
|
setAutoResolve ( boolean $automatic = TRUE ) : void |
Alias for setAutoResolve() method on OODBBean. |
|
setDatabaseAdapter ( RedBeanPHP\Adapter $adapter ) : void |
Optional accessor for neat code. |
|
setErrorHandlingFUSE ( integer $mode, callable | null $func = NULL ) : array |
Sets the error mode for FUSE. |
|
setNarrowFieldMode ( boolean $mode ) : void |
Toggles Narrow Field Mode. |
|
setRedBean ( OODB $redbean ) |
Optional accessor for neat code. |
|
setWriter ( RedBeanPHP\QueryWriter $writer ) : void |
Optional accessor for neat code. |
|
setup ( string $dsn = NULL, string $username = NULL, string $password = NULL, boolean $frozen = FALSE ) : ToolBox |
Kickstarts redbean for you. This method should be called before you start using
RedBean. The Setup() method can be called without any arguments, in this case it will
try to create a SQLite database in /tmp called red.db (this only works on UNIX-like systems). |
|
startLogging ( ) : void |
Starts logging queries. |
|
stopLogging ( ) : void |
Stops logging, comfortable method to stop logging of queries. |
|
store ( OODBBean | SimpleModel $bean ) : integer | string |
Stores a bean in the database. This method takes a
OODBBean Bean Object $bean and stores it
in the database. If the database schema is not compatible
with this bean and RedBean runs in fluid mode the schema
will be altered to store the bean correctly. |
|
storeAll ( array $beans ) : array |
Short hand function to store a set of beans at once, IDs will be
returned as an array. For information please consult the R::store()
function. |
|
tag ( OODBBean $bean, mixed $tagList = NULL ) : string |
Part of RedBeanPHP Tagging API. |
|
tagged ( string $beanType, array $tagList, string $sql = '', array $bindings = [] ) : array |
Part of RedBeanPHP Tagging API. |
|
taggedAll ( string $beanType, array $tagList, string $sql = '', array $bindings = [] ) : array |
Part of RedBeanPHP Tagging API. |
|
testConnection ( ) : boolean |
Tests the connection. |
|
transaction ( callable $callback ) : mixed |
Wraps a transaction around a closure or string callback. |
|
trash ( $beanOrType, integer $id = NULL ) : void |
Removes a bean from the database. |
|
trashAll ( array $beans ) : void |
Short hand function to trash a set of beans at once. |
|
untag ( OODBBean $bean, array $tagList ) : void |
Part of RedBeanPHP Tagging API. |
|
useExportCase ( string $caseStyle = 'default' ) : void |
Selects case style for export. |
|
useWriterCache ( boolean $yesNo ) : void |
Toggles Writer Cache. |
|
wipe ( string $beanType ) : boolean |
Wipes all beans of type $beanType. |
|