You are here

entity_share_field_collection.export.inc in Entity Share 7

Class for handling Field Collection Export.

File

modules/entity_share_field_collection/includes/entity_share_field_collection.export.inc
View source
<?php

/**
 * @file
 * Class for handling Field Collection Export.
 */

/**
 * A class to export the field collection.
 */
class EntityShareFieldCollectionExport extends EntityShareFieldCollectionAbstract {

  /**
   * Manage field collection for the export.
   */
  public function exportDatas() {

    // Check if the field type is managed by the module.
    if (!$this
      ->isManagedFieldType()) {
      return;
    }

    // If we already come from content field walk
    // (field collection of field collection...).
    if (isset($this->fieldData['entity_type']) && $this->fieldData['entity_type'] == $this->fieldEntityType) {
      $field_collection = (object) $this->fieldData;
    }
    else {
      $field_value = $this->fieldData['value'];
      $field_collection = field_collection_item_load($field_value);
    }
    $field_export = new EntityShareEntityExport($field_collection);
    $field_collection = $field_export
      ->execute();
    $this->fieldData = get_object_vars($field_collection);
  }

}

Classes

Namesort descending Description
EntityShareFieldCollectionExport A class to export the field collection.