You are here

protected static function FeedImport::applyFilter in Feed Import 7.2

Same name and namespace in other branches
  1. 7 feed_import.inc.php \FeedImport::applyFilter()

Filters a field

Parameters

mixed $field: A string or array of strings containing field value

array $filters: Filters to apply

Return value

mixed Filtered value of field

1 call to FeedImport::applyFilter()
FeedImport::createEntity in ./feed_import.inc.php
Create Entity object

File

./feed_import.inc.php, line 839
Feed import class for parsing and processing content.

Class

FeedImport
@file Feed import class for parsing and processing content.

Code

protected static function applyFilter($field, &$filters) {
  $field_param = variable_get('feed_import_field_param_name', '[field]');
  foreach ($filters as &$filter) {
    $filter['#pvhold'] = $field;
    try {
      $field = call_user_func_array($filter['#function'], $filter['#params']);
    } catch (Exception $e) {

      // Just report this error, nothing to handle.
    }
    $filter['#pvhold'] = NULL;
  }
  return $field;
}