You are here

public function TransactionType::isApplicable in Transaction 8

Check if the type of transaction is applicable to a particular entity.

Parameters

\Drupal\Core\Entity\ContentEntityInterface $entity: The content entity to check.

Return value

bool TRUE if transaction type is applicable to the given entity.

Overrides TransactionTypeInterface::isApplicable

File

src/Entity/TransactionType.php, line 234

Class

TransactionType
Provides a type of transaction.

Namespace

Drupal\transaction\Entity

Code

public function isApplicable(ContentEntityInterface $entity) {
  if ($result = in_array($entity
    ->bundle(), $this
    ->getBundles(TRUE))) {
    $result = $this
      ->getPlugin()
      ->isApplicable($entity, $this);
  }
  return $result;
}