function ctools_export_crud_load_multiple

Load multiple exportable objects.

Parameters

$table: The name of the table to use to retrieve $schema values. This table must have an 'export' section containing data or this function will fail.

$names: An array of unique IDs to load. The field for these IDs will be specified by the export key, which normally defaults to 'name'.

Return value

An array of the loaded objects.

Related topics

3 calls to ctools_export_crud_load_multiple()
CtoolsExportCrudTestCase::testCrudExportLoadMultiple in tests/ctools_export_test/ctools_export.test
Tests CRUD operation: Load multiple.
ctools_drush_export_op in drush/ctools.drush.inc
Iterate through exportable object names, load them, and pass each object to the correct op function.
ctools_export_default_to_hook_code in includes/export.inc
Default function to export objects to code.

File

includes/export.inc, line 102

Code

function ctools_export_crud_load_multiple($table, array $names) {
    $schema = ctools_export_get_schema($table);
    $export = $schema['export'];
    $results = array();
    if (!empty($export['load multiple callback']) && function_exists($export['load multiple callback'])) {
        $results = $export['load multiple callback']($names);
    }
    else {
        $results = ctools_export_load_object($table, 'names', $names);
    }
    // Ensure no empty results are returned.
    return array_filter($results);
}