You are here

abstract class EntityShareFieldCollectionAbstract in Entity Share 7

Abstract class for Field Collection import/export management.

Hierarchy

Expanded class hierarchy of EntityShareFieldCollectionAbstract

File

modules/entity_share_field_collection/includes/entity_share_field_collection.abstract.inc, line 11
Class for handling Field Collection Import/Export Abstract.

View source
abstract class EntityShareFieldCollectionAbstract {

  /**
   * Data of the field.
   *
   * @var array
   *   Data of the field.
   */
  protected $fieldData;

  /**
   * Field name.
   *
   * @var string
   *   Machine name of the field.
   */
  protected $fieldName;

  /**
   * Field type.
   *
   * @var string
   *   Type of the field.
   */
  protected $fieldType;

  /**
   * Entity object.
   *
   * @var object
   *   Entity.
   */
  protected $entity;

  /**
   * Field metadatas.
   *
   * @var array
   *   Field info.
   */
  protected $fieldInfo;

  /**
   * Language of the current data.
   *
   * @var string
   *   Language.
   */
  protected $fieldLang;

  /**
   * Delta of the field.
   *
   * @var int
   *   Delta of the field (0, 1 etc).
   */
  protected $delta;

  /**
   * Entity share object.
   *
   * @var EntityShareEntityAbstract
   *   EntityShareEntity object.
   */
  protected $entityShareEntity;

  /**
   * Types managed by the class.
   *
   * @var array
   *   Type of field types managed.
   */
  protected $managedFieldTypes = array(
    'field_collection',
  );

  /**
   * Current field entity type.
   *
   * @var string
   *   Entity type of the field.
   */
  protected $fieldEntityType = 'field_collection_item';

  /**
   * Constructor. Initialize properties.
   *
   * @param array $field_data
   *   Datas of the field.
   * @param string $field_name
   *   Name of the field.
   * @param string $field_type
   *   Type of the field.
   * @param object $entity
   *   Current entity to import or export.
   * @param array $field_info
   *   Info of the field.
   * @param string $lang
   *   Language of the field.
   * @param int $delta
   *   Delta of the field.
   * @param EntityShareEntityAbstract $entity_share_entity
   *   The EntityShareEntityAbstract object.
   */
  public function __construct(array &$field_data, $field_name, $field_type, $entity, array $field_info, $lang, $delta, EntityShareEntityAbstract $entity_share_entity) {
    $this->fieldData =& $field_data;
    $this->fieldName = $field_name;
    $this->fieldType = $field_type;
    $this->entity = $entity;
    $this->fieldInfo = $field_info;
    $this->fieldLang = $lang;
    $this->fieldDelta = $delta;
    $this->entityShareEntity = $entity_share_entity;
  }

  /**
   * Check if the field type is managed.
   *
   * @return bool
   *   TRUE if the current module can handle the field type, FALSE otherwise.
   */
  public function isManagedFieldType() {
    return in_array($this->fieldType, $this->managedFieldTypes);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
EntityShareFieldCollectionAbstract::$delta protected property Delta of the field.
EntityShareFieldCollectionAbstract::$entity protected property Entity object.
EntityShareFieldCollectionAbstract::$entityShareEntity protected property Entity share object.
EntityShareFieldCollectionAbstract::$fieldData protected property Data of the field.
EntityShareFieldCollectionAbstract::$fieldEntityType protected property Current field entity type.
EntityShareFieldCollectionAbstract::$fieldInfo protected property Field metadatas.
EntityShareFieldCollectionAbstract::$fieldLang protected property Language of the current data.
EntityShareFieldCollectionAbstract::$fieldName protected property Field name.
EntityShareFieldCollectionAbstract::$fieldType protected property Field type.
EntityShareFieldCollectionAbstract::$managedFieldTypes protected property Types managed by the class.
EntityShareFieldCollectionAbstract::isManagedFieldType public function Check if the field type is managed.
EntityShareFieldCollectionAbstract::__construct public function Constructor. Initialize properties.