You are here

abstract class FeedImportMergeField in Feed Import 8

Abstract class that helps merging fields on update.

Hierarchy

Expanded class hierarchy of FeedImportMergeField

1 string reference to 'FeedImportMergeField'
FeedImportProcessor::setFields in feed_import_base/src/FeedImportProcessor.php
Sets entity fields.

File

feed_import_base/src/FeedImportMergeField.php, line 7

Namespace

Drupal\feed_import_base
View source
abstract class FeedImportMergeField {

  /**
   * Remove field if is missing from source.
   *
   * @return bool
   *    True to overwrite
   */
  public function overwriteEmpty() {
    return FALSE;
  }

  /**
   * Merge the new and current field values.
   * The merge should be set in $current ref. variable
   *
   * @param array $current
   *    Current field values
   * @param array $new
   *    New field values
   * @param array $field
   *    Field info
   *      cardinality - field cardinality
   *      compare - compare function for field value
   *
   * @return bool
   *    True if $current was changed
   */
  public abstract function merge(array &$current, array &$new, array &$field);

}

Members

Namesort descending Modifiers Type Description Overrides
FeedImportMergeField::merge abstract public function Merge the new and current field values. The merge should be set in $current ref. variable 4
FeedImportMergeField::overwriteEmpty public function Remove field if is missing from source. 1