You are here

public function Heartbeat::heartbeat_get_type in Heartbeat 8

Returns the node type label for the passed node.

Parameters

\Drupal\heartbeat\Entity\HeartbeatInterface $heartbeat: A heartbeat entity to return the heartbeat type's label for.

Return value

string|false The heartbeat type label or FALSE if the heartbeat type is not found.

File

src/Entity/Heartbeat.php, line 442

Class

Heartbeat

Namespace

Drupal\heartbeat\Entity

Code

public function heartbeat_get_type(HeartbeatInterface $heartbeat) {
  $type = HeartbeatType::load($heartbeat
    ->bundle());
  return $type ? $type
    ->label() : FALSE;
}