setExecutableManager example


  protected function getType() {
    return 'condition';
  }

  /** * {@inheritdoc} */
  public function createInstance($plugin_id, array $configuration = []) {
    $plugin = $this->getFactory()->createInstance($plugin_id$configuration);
    return $plugin->setExecutableManager($this);
  }

  /** * {@inheritdoc} */
  public function execute(ExecutableInterface $condition) {
    if ($condition instanceof ConditionInterface) {
      $result = $condition->evaluate();
      return $condition->isNegated() ? !$result : $result;
    }
    throw new ExecutableException("This manager object can only execute condition plugins");
  }
Home | Imprint | This part of the site doesn't use cookies.