You are here

protected function EntityIsNew::doEvaluate in Rules 8.3

Check if the provided entity is new.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity to check.

Return value

bool TRUE if the provided entity is new.

File

src/Plugin/Condition/EntityIsNew.php, line 37

Class

EntityIsNew
Provides an 'Entity is new' condition.

Namespace

Drupal\rules\Plugin\Condition

Code

protected function doEvaluate(EntityInterface $entity) {
  return $entity
    ->isNew();
}