Commit b0ef93f4 authored by jaapjansma's avatar jaapjansma

added add condition to the container

parent 1b962ea2
......@@ -2,6 +2,7 @@
namespace Civi\ActionProvider;
use Civi\ActionProvider\Condition\AbstractCondition;
use \Civi\ActionProvider\Provider;
class Container {
......@@ -95,6 +96,21 @@ class Container {
}
return $this;
}
/**
* Add an condition class to the list of available conditions.
*
* @param \Civi\ActionProvider\Condition\AbstractCondition $condition
* @return Container
* @throws \Exception
*/
public function addCondition(AbstractCondition $condition) {
$this->defaultProvider->addCondition($condition);
foreach($this->providerContexts as $provider) {
$provider->addCondition($condition);
}
return $this;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment