This method will export an array of beans in the first argument to a
set of arrays. This can be used to send JSON or XML representations
of bean hierarchies to the client.
For every bean in the array this method will export:
- contents of the bean
- all own bean lists (recursively)
- all shared beans (but not THEIR own lists)
If the second parameter is set to TRUE the parents of the beans in the
array will be exported as well (but not THEIR parents).
The third parameter can be used to provide a white-list array
for filtering. This is an array of strings representing type names,
only the type names in the filter list will be exported.
The fourth parameter can be used to change the keys of the resulting
export arrays. The default mode is 'snake case' but this leaves the
keys as-is, because 'snake' is the default case style used by
RedBeanPHP in the database. You can set this to 'camel' for
camel cased keys or 'dolphin' (same as camelcase but id will be
converted to ID instead of Id).
public exportAll ( array | RedBeanPHP\OODBBean $beans, boolean $parents = FALSE, array $filters = [], string $caseStyle = 'snake' ) : array | ||
$beans | array | RedBeanPHP\OODBBean | beans to be exported |
$parents | boolean | also export parents |
$filters | array | only these types (whitelist) |
$caseStyle | string | case style identifier |
return | array |