Generator/BaseGenerator.php
protected function filterComponentContentsForRole($contents, $role) {
    $return = [];
    foreach ($contents as $key => $item) {
      if ($item['role'] == $role) {
        $return[$key] = $item['content'];
      }
    }
    return $return;
  }
protected function filterComponentContentsForRole($contents, $role) {
    $return = [];
    foreach ($contents as $key => $item) {
      if ($item['role'] == $role) {
        $return[$key] = $item['content'];
      }
    }
    return $return;
  }
protected function filterComponentContentsForRole ( $ contents , $ role ) { $ return = [ ] ; foreach ( $ contents as $ key => $ item ) { if ( $ item [ 'role' ] == $ role ) { $ return [ $ key ] = $ item [ 'content' ] ; } } return $ return ; }
Filters an array of child contents by role.

Helper for buildComponentContents().

@param $contents
The array of contents as returned by an implementation of
buildComponentContents().
@param $role
A role name, as used in the 'role' property of the $contents array.

@return
An array of the 'content' data of the given array items that matched the
role, keyed by the same key as the the given array item.
Filters an array of child contents by role .