function NodeIsOfType::doEvaluate

Check if a node is of a specific set of types.

Parameters

\Drupal\node\NodeInterface $node: The node to check for a type.

string[] $types: An array of type names as strings.

Return value

bool TRUE if the node type is in the array of types.

File

src/Plugin/Condition/NodeIsOfType.php, line 43

Class

NodeIsOfType
Provides a 'Node is of type' condition.

Namespace

Drupal\rules\Plugin\Condition

Code

protected function doEvaluate(NodeInterface $node, array $types) {
    return in_array($node->getType(), $types);
}