Returns whether the given item has a specific descendant.
@param string $itemName name of the item.
@param string $descendantName name of the descendant.
@return boolean the result.
422430
public function hasDescendant($itemName, $descendantName)
    {
        $descendants = $this->getDescendants($itemName);
        return isset($descendants[$descendantName]);
    }
735390
def _check_descendant(self, item):
        """"""
        children = self.get_children(item)
        for iid in children:
            self.change_state(iid, "checked")
            self._check_descendant(iid)
858931
public function get($sectionName, $itemName, $defaultValue = null)
    {
        $section = $this->getSection($sectionName);

        return $section->get($itemName, $defaultValue);
    }
146404
protected function detectLoop($itemName,$childName)
	{
		if($childName===$itemName)
			return true;
		if(!isset($this->_children[$childName], $this->_items[$itemName]))
			return false;

		foreach($this->_children[$childName] as $child)
		{
			if($this->detectLoop($itemName,$child->getName()))
				return true;
		}
		return false;
	}
782938
def is_descendant_of(self, node):
        
        return (
            self.tree_id == node.tree_id and
            self.lft > node.lft and
            self.rgt < node.rgt
        )
691467
private function existInArray($items, $routeName): bool
    {
        foreach ($items as $item) {

            if ($item['route'] == $routeName) {
                return true;
            }

            if (array_key_exists('children', $item)) {
                $found = $this->existInArray($item['children'], $routeName);

                if ($found) {
                    return true;
                }
            }
        }

        return false;
    }
1236951
private function subtag_check ($tagName)
  {
    $propName = lcfirst ($tagName);
    if ($this->current instanceof Metadata) {
      switch ($this->current->type) {
        // All descendants of a metadata property are always metadata.
        case type::metadata:
          return true;
      }
      // Descendants of a content property are children, not properties.
      return false;
    }
    // If the current component defines an property with the same name as the tag being checked, and if that property
    // supports begin specified as a tag, the tag is a subtag.
    return $this->current->supportsProperties () && $this->current->props->defines ($propName, true);
  }
1309782
public boolean hasChild(String name) {
	for (ParseTreeNode child : children) {
	    if (child.getName().equals(name)) {
		return true;
	    }
	}
	return false;
    }
1312328
@Override
    @SuppressWarnings("deprecation")
    public boolean canRemoveItem( String itemName ) {
        CheckArg.isNotNull(itemName, "itemName");
        Name childName = context.getValueFactories().getNameFactory().create(itemName);
        return nodeTypes().canRemoveItem(this.name, null, childName, true);
    }
316870
private function _createSharedInstance($itemName)
        {
            if (!isset($this->_store[$itemName]['instance'])) {
                $this->_store[$itemName]['instance'] = $this->_createNewInstance($itemName);
            }

            return $this->_store[$itemName]['instance'];
        }
145776
public function actionRemoveChild($itemName, $childName)
    {
        /* @var $am CAuthManager|AuthBehavior */
        $am = Yii::app()->getAuthManager();

        if ($am->hasItemChild($itemName, $childName)) {
            $am->removeItemChild($itemName, $childName);
            if ($am instanceof CPhpAuthManager) {
                $am->save();
            }
        }

        $this->redirect(array('view', 'name' => $itemName));
    }
989277
public function has($itemName)
    {
        return array_key_exists($itemName, $this->store)
            && isset($this->store[$itemName]['lookupType']);
    }
503664
private boolean hasSelectedChildren(CmsTreeItem item) {

        for (String childId : m_childrens.get(item.getId())) {
            CmsTreeItem child = m_categories.get(childId);
            if (child.getCheckBox().isChecked() || hasSelectedChildren(child)) {
                return true;
            }
        }
        return false;
    }
106846
public function hasDescendant(ClassName $className, Comparator $comparator = null)
    {
        if ($this->isAbsolute() !== $className->isAbsolute()) {
            return false;
        }

        if (null === $comparator) {
            $comparator = new Comparator;
        }

        while ($className->hasParent()) {
            $className = $className->parent();
            if ($comparator->equals($this, $className)) {
                return true;
            }
        }

        return false;
    }
966292
public function get_old_parentid($itemname) {
        return array_key_exists($itemname, $this->elementsoldid) ? $this->elementsoldid[$itemname] : null;
    }
593262
private function findSiblingNamed($siblingName)
    {
        Assert::assertInstanceOf(CollectionDoc::class, $this->lastDocumenation);

        foreach ($this->lastDocumenation->getSiblingList() as $sibling) {
            if ($siblingName === $sibling->getName()) {
                return $sibling;
            }
        }

        throw new \Exception(sprintf('Unable to find sibling named "%s"', $siblingName));
    }
529820
public function isChildOf($node) {
        $result = $this->owner->getAttribute($this->leftAttribute) > $node->getAttribute($this->leftAttribute) && $this->owner->getAttribute($this->rightAttribute) < $node->getAttribute($this->rightAttribute);

        if ($result && $this->treeAttribute !== false) {
            $result = $this->owner->getAttribute($this->treeAttribute) === $node->getAttribute($this->treeAttribute);
        }

        return $result;
    }