Method |
Description |
|
__construct ( ToolBox $tools ) |
Constructor |
|
associate ( redbeanphp\OODBBean | array $beans1, redbeanphp\OODBBean | array $beans2 ) : array |
Associates two beans in a many-to-many relation. |
|
clearRelations ( redbeanphp\OODBBean $bean, string $type ) : void |
Removes all relations for a bean. This method breaks every connection between
a certain bean $bean and every other bean of type $type. Warning: this method
is really fast because it uses a direct SQL query however it does not inform the
models about this. If you want to notify FUSE models about deletion use a foreach-loop
with unassociate() instead. (that might be slower though) |
|
getTable ( array $types ) : string |
Creates a table name based on a types array. |
|
related ( redbeanphp\OODBBean | array $bean, string $type, string $sql = '', array $bindings = [] ) : array |
Returns all the beans associated with $bean. |
|
relatedCount ( redbeanphp\OODBBean | array $bean, string $type, string $sql = NULL, array $bindings = [] ) : integer |
Counts the number of related beans in an N-M relation. |
|
unassociate ( $beans1, $beans2, boolean $fast = NULL ) : void |
Breaks the association between two beans. This method unassociates two beans. If the
method succeeds the beans will no longer form an association. In the database
this means that the association record will be removed. This method uses the
OODB trash() method to remove the association links, thus giving FUSE models the
opportunity to hook-in additional business logic. If the $fast parameter is
set to boolean TRUE this method will remove the beans without their consent,
bypassing FUSE. This can be used to improve performance. |
|