Gets the display options set for a component.
string $name: The name of the component.
array|null The display options for the component, or NULL if the component is not displayed.
Overrides EntityDisplayBaseInterface::getComponent
public function getComponent($name) {
// We always store 'extra fields', whether they are visible or hidden.
$extra_fields = field_info_extra_fields($this->targetEntityType, $this->bundle, $this->displayContext);
if (isset($extra_fields[$name])) {
// If we have explicit settings, return an array or NULL depending on
// visibility.
if (isset($this->content[$name])) {
if ($this->content[$name]['visible']) {
return array(
'weight' => $this->content[$name]['weight'],
);
}
else {
return NULL;
}
}
// If no explicit settings for the extra field, look at the default
// visibility in its definition.
$definition = $extra_fields[$name];
if (!isset($definition['visible']) || $definition['visible'] == TRUE) {
return array(
'weight' => $definition['weight'],
);
}
else {
return NULL;
}
}
if (isset($this->content[$name])) {
return $this->content[$name];
}
}