public function FieldCollectionItemEntity::hostEntity in Field collection 7
Returns the host entity, which embeds this field collection item.
7 calls to FieldCollectionItemEntity::hostEntity()
- FieldCollectionItemEntity::copyTranslations in ./
field_collection.entity.inc - Copies text to all languages the collection item has a translation for.
- FieldCollectionItemEntity::defaultLabel in ./
field_collection.entity.inc - Specifies the default label, which is picked up by label() by default.
- FieldCollectionItemEntity::deleteHostEntityReference in ./
field_collection.entity.inc - Deletes the host entity's reference of the field collection item.
- FieldCollectionItemEntity::delta in ./
field_collection.entity.inc - Determines the $delta of the reference pointing to this field collection item.
- FieldCollectionItemEntity::hostEntityBundle in ./
field_collection.entity.inc - Returns the bundle of the host entity, which embeds this field collection item.
File
- ./
field_collection.entity.inc, line 266
Class
- FieldCollectionItemEntity
- Class for field_collection_item entities.
Code
public function hostEntity() {
if ($this
->fetchHostDetails()) {
if (!isset($this->hostEntity) && $this
->isInUse()) {
$this->hostEntity = entity_load_single($this->hostEntityType, $this->hostEntityId);
}
elseif (!isset($this->hostEntity) && $this->hostEntityRevisionId) {
$this->hostEntity = entity_revision_load($this->hostEntityType, $this->hostEntityRevisionId);
}
return $this->hostEntity;
}
}