You are here

public function RulesConditionalElement::getAllSibling in Conditional Rules 7

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

Gets sibling elements.

Return value

array of RulesPlugin objects.

1 call to RulesConditionalElement::getAllSibling()
RulesConditionalDefaultCase::canEvaluate in includes/rules_conditional.plugin.inc
Determines whether this branch can be evaluated.

File

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

Class

RulesConditionalElement
Base conditional element plugin implementation.

Code

public function getAllSibling() {
  if (isset($this->parent)) {
    $siblings = NULL;
    foreach ($this->parent
      ->getIterator() as $element) {
      if (!($element === $this)) {
        $siblings[] = $element;
      }
    }
    return $siblings;
  }

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