Property | Type | Description | |
---|---|---|---|
$nesting | * | ||
$stash | array | ||
$writer |
Method | Description | |
---|---|---|
__construct ( redbeanphp\OODB $oodb, RedBeanPHP\QueryWriter $writer ) : void | Constructor, requires a query writer. | |
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. | |
check ( redbeanphp\OODBBean $bean ) : void | Checks whether a OODBBean bean is valid. | |
convertToBeans ( string $type, array $rows, string $mask = NULL ) : array | This is a convenience method; it converts database rows (arrays) into beans. Given a type and a set of rows this method will return an array of beans of the specified type loaded with the data fields provided by the result set from the database. | |
count ( string $type, string $addSQL = '', array $bindings = [] ) : integer | Counts the number of beans of type $type. | |
find ( string $type, array $conditions = [], $sql = NULL, array $bindings = [] ) : array | Searches the database for a bean that matches conditions $conditions and sql $addSQL and returns an array containing all the beans that have been found. | |
findCollection ( string $type, string $sql, array $bindings = [] ) : redbeanphp\BeanCollection | Finds a BeanCollection. | |
store ( redbeanphp\OODBBean | redbeanphp\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. | |
tableExists ( string $table ) : boolean | Checks whether the specified table already exists in the database. | |
trash ( redbeanphp\OODBBean | redbeanphp\SimpleModel $bean ) : void | Removes a bean from the database. | |
wipe ( string $type ) : boolean | Trash all beans of a given type. Wipes an entire type of bean. |
Method | Description | |
---|---|---|
hasListsOrObjects ( redbeanphp\OODBBean $bean ) : boolean | Determines whether the bean has 'loaded lists' or 'loaded embedded beans' that need to be processed by the store() method. | |
prepareEmbeddedBean ( redbeanphp\OODBBean | redbeanphp\SimpleModel $embeddedBean ) : integer | Processes an embedded bean. | |
processEmbeddedBean ( array &$embeddedBeans, redbeanphp\OODBBean $bean, string $property, redbeanphp\OODBBean $value ) : void | Converts an embedded bean to an ID, removed the bean property and stores the bean in the embedded beans array. | |
processGroups ( array $originals, array $current, array $additions, array $trashcan, array $residue ) : array | Process groups. Internal function. Processes different kind of groups for storage function. Given a list of original beans and a list of current beans, this function calculates which beans remain in the list (residue), which have been deleted (are in the trashcan) and which beans have been added (additions). | |
processResidue ( array $ownresidue ) : void | Processes a list of beans from a bean. A bean may contain lists. This method handles own lists; i.e. the $bean->ownObject properties. | |
processSharedAdditions ( redbeanphp\OODBBean $bean, array $sharedAdditions ) : void | Processes a list of beans from a bean. A bean may contain lists. This method handles shared addition lists; i.e. the $bean->sharedObject properties. | |
processSharedResidue ( redbeanphp\OODBBean $bean, array $sharedresidue ) : void | Stores all the beans in the residue group. | |
processSharedTrashcan ( redbeanphp\OODBBean $bean, array $sharedTrashcan ) : void | Unassociates the list items in the trashcan. | |
processTrashcan ( redbeanphp\OODBBean $bean, array $ownTrashcan ) : void | Processes a list of beans from a bean. A bean may contain lists. This method handles own lists; i.e. the $bean->ownObject properties. | |
storeBeanWithLists ( redbeanphp\OODBBean $bean ) : void | Stores a bean and its lists in one run. |
public __construct ( redbeanphp\OODB $oodb, RedBeanPHP\QueryWriter $writer ) : void | ||
$oodb | redbeanphp\OODB | |
$writer | RedBeanPHP\QueryWriter | the Query Writer to use for this repository |
return | void |
array(
'PROPERTY' => array( POSSIBLE VALUES... 'John', 'Steve' )
'PROPERTY' => array( POSSIBLE VALUES... )
);
All conditions are glued together using the AND-operator, while all value lists
are glued using IN-operators thus acting as OR-conditions.
Note that you can use property names; the columns will be extracted using the
appropriate bean formatter. protected hasListsOrObjects ( redbeanphp\OODBBean $bean ) : boolean | ||
$bean | redbeanphp\OODBBean | bean to be examined |
return | boolean |
protected prepareEmbeddedBean ( redbeanphp\OODBBean | redbeanphp\SimpleModel $embeddedBean ) : integer | ||
$embeddedBean | redbeanphp\OODBBean | redbeanphp\SimpleModel | the bean or model |
return | integer |
protected processEmbeddedBean ( array &$embeddedBeans, redbeanphp\OODBBean $bean, string $property, redbeanphp\OODBBean $value ) : void | ||
$embeddedBeans | array | destination array for embedded bean |
$bean | redbeanphp\OODBBean | target bean to process |
$property | string | property that contains the embedded bean |
$value | redbeanphp\OODBBean | embedded bean itself |
return | void |
protected processGroups ( array $originals, array $current, array $additions, array $trashcan, array $residue ) : array | ||
$originals | array | originals |
$current | array | the current beans |
$additions | array | beans that have been added |
$trashcan | array | beans that have been deleted |
$residue | array | beans that have been left untouched |
return | array |
protected processResidue ( array $ownresidue ) : void | ||
$ownresidue | array | list to process |
return | void |
protected processTrashcan ( redbeanphp\OODBBean $bean, array $ownTrashcan ) : void | ||
$bean | redbeanphp\OODBBean | bean to process |
$ownTrashcan | array | list to process |
return | void |
protected storeBeanWithLists ( redbeanphp\OODBBean $bean ) : void | ||
$bean | redbeanphp\OODBBean | bean to process |
return | void |
public tableExists ( string $table ) : boolean | ||
$table | string | table name |
return | boolean |