You are here

public function RulesConditionalElement::getNextSibling in Conditional Rules 8

Same name and namespace in other branches
  1. 7 includes/rules_conditional.core.inc \RulesConditionalElement::getNextSibling()

Gets the next sibling element.

Return value

RulesPlugin

1 call to RulesConditionalElement::getNextSibling()
RulesConditionalElement::checkSiblings in includes/rules_conditional.core.inc
Checks basic conditional element integrity.

File

includes/rules_conditional.core.inc, line 304
Conditional Rules framework implementation.

Class

RulesConditionalElement
Base conditional element plugin implementation.

Code

public function getNextSibling() {
  if (isset($this->parent)) {
    $previous = NULL;
    foreach ($this->parent
      ->getIterator() as $element) {
      if ($previous === $this) {
        return $element;
      }
      $previous = $element;
    }
  }

  // Otherwise, return nothing if no next sibling is applicable.
  return NULL;
}