class EntityIsNew
Provides an 'Entity is new' condition.
@todo Add access callback information from Drupal 7?
Plugin annotation
@Condition(
id = "rules_entity_is_new",
label = @Translation("Entity is new"),
category = @Translation("Entity"),
context_definitions = {
"entity" = @ContextDefinition("entity",
label = @Translation("Entity"),
description = @Translation("Specifies the entity for which to evaluate the condition."),
assignment_restriction = "selector"
),
}
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase extends \Drupal\Component\Plugin\PluginInspectionInterface, \Drupal\Component\Plugin\DerivativeInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait implements \Drupal\Component\Plugin\PluginBase
- class \Drupal\Core\Executable\ExecutablePluginBase extends \Drupal\Core\Executable\ExecutableInterface, \Drupal\Core\Cache\CacheableDependencyInterface, \Drupal\Core\Plugin\ContextAwarePluginInterface uses \Drupal\Core\Plugin\ContextAwarePluginTrait implements \Drupal\Core\Plugin\PluginBase
- class \Drupal\Core\Condition\ConditionPluginBase extends \Drupal\Core\Condition\ConditionInterface uses \Drupal\Core\Plugin\ContextAwarePluginAssignmentTrait implements \Drupal\Core\Executable\ExecutablePluginBase
- class \Drupal\rules\Core\RulesConditionBase extends \Drupal\rules\Core\RulesConditionInterface uses \Drupal\rules\Context\ContextProviderTrait, \Drupal\rules\Core\ExecutablePluginTrait, \Drupal\rules\Core\ConfigurationAccessControlTrait implements \Drupal\Core\Condition\ConditionPluginBase
- class \Drupal\rules\Plugin\Condition\EntityIsNew implements \Drupal\rules\Core\RulesConditionBase
- class \Drupal\rules\Core\RulesConditionBase extends \Drupal\rules\Core\RulesConditionInterface uses \Drupal\rules\Context\ContextProviderTrait, \Drupal\rules\Core\ExecutablePluginTrait, \Drupal\rules\Core\ConfigurationAccessControlTrait implements \Drupal\Core\Condition\ConditionPluginBase
- class \Drupal\Core\Condition\ConditionPluginBase extends \Drupal\Core\Condition\ConditionInterface uses \Drupal\Core\Plugin\ContextAwarePluginAssignmentTrait implements \Drupal\Core\Executable\ExecutablePluginBase
- class \Drupal\Core\Executable\ExecutablePluginBase extends \Drupal\Core\Executable\ExecutableInterface, \Drupal\Core\Cache\CacheableDependencyInterface, \Drupal\Core\Plugin\ContextAwarePluginInterface uses \Drupal\Core\Plugin\ContextAwarePluginTrait implements \Drupal\Core\Plugin\PluginBase
- class \Drupal\Core\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait implements \Drupal\Component\Plugin\PluginBase
Expanded class hierarchy of EntityIsNew
File
-
src/
Plugin/ Condition/ EntityIsNew.php, line 26
Namespace
Drupal\rules\Plugin\ConditionView source
class EntityIsNew extends RulesConditionBase {
/**
* Check if the provided entity is new.
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity to check.
*
* @return bool
* TRUE if the provided entity is new.
*/
protected function doEvaluate(EntityInterface $entity) {
return $entity->isNew();
}
}