You are here

function _ctools_drush_count_exportables in Chaos Tool Suite (ctools) 7

Return an array of count information based on exportables array.

Parameters

$exportables: Array of exportables to count.

Return value

Array of count data containing the following: 'total' - A total count of all exportables. 'exportables' - An array of exportable counts per table.

1 call to _ctools_drush_count_exportables()
ctools_drush_export_info in drush/ctools.drush.inc
Drush callback: Export info.

File

drush/ctools.drush.inc, line 846
CTools Drush commands.

Code

function _ctools_drush_count_exportables($exportables) {
  $count = array(
    'exportables' => array(),
  );
  foreach ($exportables as $table => $objects) {

    // Add the object count for each table.
    $count['exportables'][$table] = count($objects);
  }

  // Once all tables have been counted, total these up.
  $count['total'] = array_sum($count['exportables']);
  return $count;
}