You are here

class Condition in Rules 8.3

Extension of the Condition annotation class.

This class adds a configuration access parameter to the Condition annotation.

Hierarchy

Expanded class hierarchy of Condition

8 string references to 'Condition'
ConditionForm::form in src/Form/Expression/ConditionForm.php
Adds elements specific to the expression to the form.
ConfigureAndExecuteTest::testConfigureAndExecute in tests/src/Functional/ConfigureAndExecuteTest.php
Tests creation of a rule and then triggering its execution.
ConfigureAndExecuteTest::testMultipleInputContext in tests/src/Functional/ConfigureAndExecuteTest.php
Tests user input in context form for 'multiple' valued context variables.
RulesUiEmbedTest::testExampleUi in tests/src/Functional/RulesUiEmbedTest.php
@covers \Drupal\rules_test_ui_embed\Form\SettingsForm
TempStorageTest::testLocking in tests/src/Functional/TempStorageTest.php
Tests that editing a rule locks it for another user.

... See full list

7 classes are annotated with Condition
IpIsBanned in src/Plugin/Condition/IpIsBanned.php
Provides an 'IP address is blocked' condition.
NodeIsOfType in src/Plugin/Condition/NodeIsOfType.php
Provides a 'Node is of type' condition.
TestConditionFalse in tests/modules/rules_test/src/Plugin/Condition/TestConditionFalse.php
Provides an always-FALSE test condition.
TestConditionProvider in tests/modules/rules_test/src/Plugin/Condition/TestConditionProvider.php
Test condition that adds a variable with the provided context.
TestConditionTrue in tests/modules/rules_test/src/Plugin/Condition/TestConditionTrue.php
Provides an always-TRUE test condition.

... See full list

File

src/Core/Annotation/Condition.php, line 15

Namespace

Drupal\rules\Core\Annotation
View source
class Condition extends CoreConditionAnnotation {

  /**
   * The permissions allowed to access the configuration UI for this plugin.
   *
   * @var string[]
   *   Array of permission strings as declared in a *.permissions.yml file. If
   *   any one of these permissions apply for the relevant user, we allow
   *   access.
   *
   *   The key should be used as follows. Note that we add a space between "@"
   *   and "Condition", since we do not want to trigger the annotation parser
   *   here; you should remove that space in your actual annotation:
   *
   *   @ Condition(
   *     id = "my_module_user_is_blocked",
   *     label = @Translation("My User is blocked"),
   *     category = @Translation("User"),
   *     context_definitions = {
   *       "user" = @ContextDefinition("entity:user",
   *         label = @Translation("User")
   *      ),
   *      configure_permissions = {
   *        "administer users",
   *        "block users"
   *      }
   *   }
   * )
   */
  public $configure_permissions;

}

Members

Namesort descending Modifiers Type Description Overrides
Condition::$category public property The category under which the condition should listed in the UI.
Condition::$configure_permissions public property The permissions allowed to access the configuration UI for this plugin.
Condition::$context Deprecated public property An array of context definitions describing the context used by the plugin.
Condition::$context_definitions public property An array of context definitions describing the context used by the plugin.
Condition::$id public property The condition plugin ID.
Condition::$label public property The human-readable name of the condition.
Condition::$module public property The name of the module providing the type.
Plugin::$definition protected property The plugin definition read from the class annotation. 1
Plugin::get public function Gets the value of an annotation. Overrides AnnotationInterface::get 5
Plugin::getClass public function Gets the class of the annotated class. Overrides AnnotationInterface::getClass
Plugin::getId public function Gets the unique ID for this annotated class. Overrides AnnotationInterface::getId
Plugin::getProvider public function Gets the name of the provider of the annotated class. Overrides AnnotationInterface::getProvider
Plugin::parse protected function Parses an annotation into its definition.
Plugin::setClass public function Sets the class of the annotated class. Overrides AnnotationInterface::setClass
Plugin::setProvider public function Sets the name of the provider of the annotated class. Overrides AnnotationInterface::setProvider
Plugin::__construct public function Constructs a Plugin object. 2