You are here

public static function FeedImportFilter::removeProperty in Feed Import 8

Same name in this branch
  1. 8 feed_import_base/filters/feed_import_default_filters.php \FeedImportFilter::removeProperty()
  2. 8 feed_import_base/src/Filter/FeedImportFilter.php \Drupal\feed_import_base\FeedImportFilter::removeProperty()

Removes a property

Parameters

mixed $field: The field where to remove

string $property: Property to remove

Return value

mixed Field without property

File

feed_import_base/src/Filter/FeedImportFilter.php, line 185

Class

FeedImportFilter
This class contains default filters for feed import.

Namespace

Drupal\feed_import_base

Code

public static function removeProperty($field, $property = NULL) {
  if ($property) {
    if (is_array($field)) {
      unset($field[$property]);
    }
    elseif (is_object($field)) {
      unset($field->{$property});
    }
  }
  return $field;
}