function RealisticDummyContentEntityBase::GetBundle in Realistic Dummy Content 7
Get the bundle of the entity being manipulated.
All entities must have a type and a bundle. The type can be node, user, etc. and the bundle can be article, page. In case of a user, there must be a bundle even if there is only one: it is called user, like the entity type.
Return value
The bundle, for example "article" or "user". Is a bundle is not readily available, return the entity type.
1 call to RealisticDummyContentEntityBase::GetBundle()
- RealisticDummyContentFieldModifier::GetFields in api/
includes/ RealisticDummyContentEntityFieldModifier.inc - Get fields for the entity, for example body or field_image.
File
- api/
includes/ RealisticDummyContentEntityBase.inc, line 114 - Define RealisticDummyContentEntityBase autoload class.
Class
- RealisticDummyContentEntityBase
- Generic entity manipulator.
Code
function GetBundle() {
$entity = $this
->GetEntity();
if (isset($entity->type)) {
return $entity->type;
}
else {
return $this
->GetType();
}
}