You are here

class DefaultTypeProcessor in Content Synchronizer 3.x

Class DefaultTypeProcessor.

@package Drupal\content_synchronizer\Processors\Type

Hierarchy

Expanded class hierarchy of DefaultTypeProcessor

File

src/Processors/Type/DefaultTypeProcessor.php, line 13

Namespace

Drupal\content_synchronizer\Processors\Type
View source
class DefaultTypeProcessor implements TypeProcessorInterface {

  /**
   * {@inheritdoc}
   */
  public function getPluginId() {
    return 'type_processor_default';
  }

  /**
   * {@inheritdoc}
   */
  public function getPluginDefinition() {
    return [];
  }

  /**
   * {@inheritdoc}
   */
  public function getExportedData(TypedData $propertyData) {
    $data = [];
    foreach ($propertyData as $value) {
      $data[] = $value
        ->getValue();
    }
    return $data;
  }

  /**
   * {@inheritdoc}
   */
  public function initImportedEntity(EntityInterface $entityToImport, $propertyId, array $data) {
    $entityToImport
      ->set($propertyId, $data[$propertyId]);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DefaultTypeProcessor::getExportedData public function Get the data to export. Overrides TypeProcessorInterface::getExportedData
DefaultTypeProcessor::getPluginDefinition public function Gets the definition of the plugin implementation. Overrides PluginInspectionInterface::getPluginDefinition
DefaultTypeProcessor::getPluginId public function Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface::getPluginId
DefaultTypeProcessor::initImportedEntity public function Init the $propertyId value in the entity to import. Overrides TypeProcessorInterface::initImportedEntity