You are here

public function NodeIsProduct::doEvaluate in Ubercart 8.4

Evaluates if the node is a product content type.

Parameters

\Drupal\node\NodeInterface $node: The node entity.

Return value

bool TRUE if the node is a product.

File

uc_product/src/Plugin/Condition/NodeIsProduct.php, line 43

Class

NodeIsProduct
Provides a 'Node is a product' condition.

Namespace

Drupal\uc_product\Plugin\Condition

Code

public function doEvaluate(NodeInterface $node) {
  return in_array($node
    ->getType(), uc_product_types());
}