You are here

public function NodeMeeting::isTypeOf in BigBlueButton 8

Check if node type is meeting.

Parameters

string|\Drupal\node\NodeInterface|\Drupal\node\NodeTypeInterface $typeOrNode: Node or node type.

Return value

bool Is node has default Meeting settings.

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

File

modules/bbb_node/src/Service/NodeMeeting.php, line 76

Class

NodeMeeting
Class NodeMeeting.

Namespace

Drupal\bbb_node\Service

Code

public function isTypeOf($typeOrNode) {
  if ($typeOrNode instanceof NodeInterface) {
    $typeOrNode = $typeOrNode
      ->getType();
  }
  if ($typeOrNode instanceof NodeTypeInterface) {
    $typeOrNode = $typeOrNode
      ->id();
  }

  /** @var \Drupal\bbb_node\Entity\BBBNodeTypeInterface $settings */
  $settings = $this->entityTypeManager
    ->getStorage('bbb_node_type')
    ->load($typeOrNode);
  if (!$settings) {
    return FALSE;
  }
  return (bool) $settings
    ->active();
}