You are here

public static function EntityHelper::filterByAccess in Helper 7

File

lib/EntityHelper.php, line 461

Class

EntityHelper

Code

public static function filterByAccess($entity_type, array $entities, $op = 'view', $account = NULL) {
  return array_filter($entities, function ($entity) use ($entity_type, $op, $account) {
    return entity_access($op, $entity_type, $entity, $account);
  });
}