/**
 * Returns the right or left sibling of a category
 *
 * @param   boolean  $right  If set to false, returns the left sibling
 *
 * @return  CategoryNode|null  CategoryNode object with the sibling information or null if there is no sibling on that side.
 *
 * @since   1.6
 */
public function getSibling($right = true)
{
    if (!$this->_allChildrenloaded) {
        $temp = $this->_constructor->get($this->id, true);
        $this->_children = $temp->getChildren();
        $this->_leftSibling = $temp->getSibling(false);
        $this->_rightSibling = $temp->getSibling(true);
        $this->setAllLoaded();
    }
    if ($right) {
        return $this->_rightSibling;
    } else {
        return $this->_leftSibling;
    }
}