You are here

abstract class EntityShareTaxonomyAbstract in Entity Share 7

Abstract class for Taxonomy import/export management.

Hierarchy

Expanded class hierarchy of EntityShareTaxonomyAbstract

File

modules/entity_share_taxonomy/includes/entity_share_taxonomy.abstract.inc, line 11
Class for handling Taxonomy Import/Export Abstract.

View source
abstract class EntityShareTaxonomyAbstract {

  /**
   * Field datas.
   *
   * @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;

  /**
   * Metadatas of the field.
   *
   * @var array
   *   Field info.
   */
  protected $fieldInfo;

  /**
   * Field language.
   *
   * @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;

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

  /**
   * Entity type of the current field.
   *
   * @var string
   *   Entity type of the field.
   */
  protected $fieldEntityType = 'taxonomy_term';

  /**
   * 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
EntityShareTaxonomyAbstract::$delta protected property Delta of the field.
EntityShareTaxonomyAbstract::$entity protected property Entity object.
EntityShareTaxonomyAbstract::$entityShareEntity protected property Entity share object.
EntityShareTaxonomyAbstract::$fieldData protected property Field datas.
EntityShareTaxonomyAbstract::$fieldEntityType protected property Entity type of the current field.
EntityShareTaxonomyAbstract::$fieldInfo protected property Metadatas of the field.
EntityShareTaxonomyAbstract::$fieldLang protected property Field language.
EntityShareTaxonomyAbstract::$fieldName protected property Field name.
EntityShareTaxonomyAbstract::$fieldType protected property Field type.
EntityShareTaxonomyAbstract::$managedFieldTypes protected property Type of field managed by the class.
EntityShareTaxonomyAbstract::isManagedFieldType public function Check if the field type is managed.
EntityShareTaxonomyAbstract::__construct public function Constructor. Initialize properties.