Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
0c5ebea2
Commit
0c5ebea2
authored
May 29, 2013
by
alexpott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#1920822
by tim.plunkett: Decouple ExecutableInterface from Conditions and FormInterface.
parent
0bed623a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
30 deletions
+31
-30
core/lib/Drupal/Core/Condition/ConditionInterface.php
core/lib/Drupal/Core/Condition/ConditionInterface.php
+29
-1
core/lib/Drupal/Core/Executable/ExecutableInterface.php
core/lib/Drupal/Core/Executable/ExecutableInterface.php
+1
-28
core/lib/Drupal/Core/Executable/ExecutablePluginBase.php
core/lib/Drupal/Core/Executable/ExecutablePluginBase.php
+1
-1
No files found.
core/lib/Drupal/Core/Condition/ConditionInterface.php
View file @
0c5ebea2
...
...
@@ -8,13 +8,28 @@
namespace
Drupal\Core\Condition
;
use
Drupal\Core\Executable\ExecutableInterface
;
use
Drupal\Core\Executable\ExecutableManagerInterface
;
use
Drupal\Core\Form\FormInterface
;
/**
* An interface for condition plugins.
*
* Condition plugins are context-aware and configurable. They support the
* following keys in their plugin definitions:
* - context: An array of context definitions, keyed by context name. Each
* context definition is a typed data definition describing the context. Check
* the typed data definition docs for details.
* - configuration: An array of configuration option definitions, keyed by
* option name. Each option definition is a typed data definition describing
* the configuration option. Check the typed data definition docs for details.
*
* @todo Replace the dependency on \Drupal\Core\Form\FormInterface with a new
* interface from https://drupal.org/node/2006248.
*
* @see \Drupal\Core\TypedData\TypedDataManager::create()
* @see \Drupal\Core\Executable\ExecutableInterface
*/
interface
ConditionInterface
extends
ExecutableInterface
{
interface
ConditionInterface
extends
ExecutableInterface
,
FormInterface
{
/**
* Determines whether condition result will be negated.
...
...
@@ -32,4 +47,17 @@ public function isNegated();
*/
public
function
evaluate
();
/**
* Provides a human readable summary of the condition's configuration.
*/
public
function
summary
();
/**
* Sets the executable manager class.
*
* @param \Drupal\Core\Executable\ExecutableManagerInterface $executableManager
* The executable manager.
*/
public
function
setExecutableManager
(
ExecutableManagerInterface
$executableManager
);
}
core/lib/Drupal/Core/Executable/ExecutableInterface.php
View file @
0c5ebea2
...
...
@@ -7,41 +7,14 @@
namespace
Drupal\Core\Executable
;
use
Drupal\Component\Plugin\ContextAwarePluginInterface
;
use
Drupal\Core\Form\FormInterface
;
/**
* An interface for executable plugins.
*
* Executable plugins are context-aware and configurable. They support the
* following keys in their plugin definitions:
* - context: An array of context definitions, keyed by context name. Each
* context definition is a typed data definition describing the context. Check
* the typed data definition docs for details.
* - configuration: An array of configuration option definitions, keyed by
* option name. Each option definition is a typed data definition describing
* the configuration option. Check the typed data definition docs for details.
*
* @see \Drupal\Core\TypedData\TypedDataManager::create()
*/
interface
ExecutableInterface
extends
ContextAwarePluginInterface
,
FormInterface
{
interface
ExecutableInterface
{
/**
* Executes the plugin.
*/
public
function
execute
();
/**
* Provides a human readable summary of the executable's configuration.
*/
public
function
summary
();
/**
* Sets the executable manager class.
*
* @param \Drupal\Core\Condition\ConditionManager $executableManager
* The executable manager.
*/
public
function
setExecutableManager
(
ExecutableManagerInterface
$executableManager
);
}
core/lib/Drupal/Core/Executable/ExecutablePluginBase.php
View file @
0c5ebea2
...
...
@@ -24,7 +24,7 @@ abstract class ExecutablePluginBase extends ContextAwarePluginBase implements Ex
protected
$executableManager
;
/**
*
Implements \Drupal\Core\Executable\ExecutableInterace::setExecutableManager().
*
{@inheritdoc}
*/
public
function
setExecutableManager
(
ExecutableManagerInterface
$executableManager
)
{
$this
->
executableManager
=
$executableManager
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment