Checks if a resource in a node has a link to the target with a shortcut.

@param \Claroline\CoreBundle\Entity\Resource\ResourceNode $parent
@param \Claroline\CoreBundle\Entity\Resource\ResourceNode $target

@return boolean
517121
public function hasLinkTo(ResourceNode $parent, ResourceNode $target)
    {
        $nodes = $this->resourceNodeRepo
            ->findBy(array('parent' => $parent, 'class' => 'Claroline\CoreBundle\Entity\Resource\ResourceShortcut'));

        foreach ($nodes as $node) {
            $shortcut = $this->getResourceFromNode($node);
            if ($shortcut->getTarget() == $target) {
                return true;
            }
        }

        return false;
    }
58558
public function set_parent(navigation_node $parent) {
        // Set the parent (thats the easy part)
        $this->parent = $parent;
        // Check if this node is active (this is checked during construction)
        if ($this->isactive) {
            // Force all of the parent nodes open so you can see this node
            $this->parent->force_open();
            // Make all parents inactive so that its clear where we are.
            $this->parent->make_inactive();
        }
    }
1164147
public function isPath( $source, $target, $hadNodes = array() )
	{
		if( $this->isEdge( $source, $target ) )
			return true;
		$nodes = $this->getTargetNodes( $source );
		$hadNodes[] = $source->getNodeName();
		foreach( $nodes as $node )
			if( !in_array( $node->getNodeName(), $hadNodes ) )
				if( $this->isPath( $node, $target, $hadNodes ) )
					return true;
		return false;
	}
93164
public function closesParent(TemplateInspector $parent)
	{
		// Test whether any of this template's root nodes closes any of given template's leaf nodes
		foreach ($this->rootNodes as $rootNode)
		{
			foreach ($parent->leafNodes as $leafNode)
			{
				if (ElementInspector::closesParent($rootNode, $leafNode))
				{
					return true;
				}
			}
		}

		return false;
	}
69810
public function hasParent($parentClassName)
    {
        $found = false;

        $this->alongParents(function ($parent) use ($parentClassName, &$found) {
            if ($parent instanceof $parentClassName) {
                $found = true;

                return false;
            }

            return true;
        });

        return $found;
    }
534178
public function setParent($parent)
    {
        if (empty($parent) || $this->getRefId() == $parent->getRefId() ||
            $parent->hasAncestor($this) || $this->hasReachedAncestorLimit()) {
            return false;
        }
        unset($this->parent);
        unset($parent->children);
        $this->trigger(static::$eventParentChanged);
        $parent->trigger(static::$eventChildAdded);
        return $this->{$this->parentAttribute} = $parent->getRefId();
    }
860733
protected function hasTargetedBinding(string $interface, string $target = null) : bool
    {
        return isset($this->bindings[$target][$interface]);
    }
308360
public function has($target, $language)
    {
        $key = $target->getId().'_'.$language;

        return isset($this->items[$key]);
    }
865841
private function setTargets(SimpleXMLElement $parent)
    {
        $xml_targets = new CNabuXMLSiteTargetList($this->nb_data_object->getTargets(true));
        $xml_targets->build($parent);
    }
828125
public function Link($action = null)
    {
        if ($this->hasParentPage()) {
            return Controller::join_links(
                $this->hasParentPage()->Link(),
                $this->hasViewAction(),
                $this->owner->RelativeLink($action)
            );
        }

        return false;
    }
342012
public function getEdge( $source, $target )
	{
		if( $source->getNodeName() < $target->getNodeName() )
			return $this->edgeSet->getEdge( $source, $target );
		else
			return $this->edgeSet->getEdge( $target, $source );
	}
443663
public function canHandle(\DOMNode $node, NodeInterface $target)
    {
        return strtolower($node->nodeName) == 'enclosure' && $target Instanceof ItemInterface;
    }
1084554
private function makeActive($item, $parent = null)
    {
        $item->links->each(function ($link) use ($item, $parent) {
            if ($link->slug == $this->active) {
                $this->makeParentActive($parent);
                $this->makeParentActive($item);

                $link->setActive(true);
            }

            if (isset($link->links)) {
                $this->makeActive($link, $item);
            }
        });
    }
729458
public function podiumMoveTo($target = null)
    {
        $newParent = Forum::find()->where(['id' => $target])->limit(1)->one();
        if (empty($newParent)) {
            Log::error('No parent forum of given ID found', $this->id, __METHOD__);
            return false;
        }

        $postsCount = $this->postsCount;
        $transaction = Forum::getDb()->beginTransaction();
        try {
            $this->forum->updateCounters(['threads' => -1, 'posts' => -$postsCount]);
            $newParent->updateCounters(['threads' => 1, 'posts' => $postsCount]);
            $this->forum_id = $newParent->id;
            $this->category_id = $newParent->category_id;
            if (!$this->save()) {
                throw new Exception('Thread saving error!');
            }
            Post::updateAll(['forum_id' => $newParent->id], ['thread_id' => $this->id]);
            $transaction->commit();
            PodiumCache::clearAfter('threadMove');
            Log::info('Thread moved', $this->id, __METHOD__);
            return true;
        } catch (Exception $e) {
            $transaction->rollBack();
            Log::error($e->getMessage(), null, __METHOD__);
        }
        return false;
    }
38126
public function hasKey($target)
    {
        foreach ($this->collection as $group => $hashMap) {
            if (array_key_exists($target, $hashMap)) {
                return true;
            }
        }

        // By default
        return false;
    }
747497
public function hasResource($resourceId)
    {
        if (array_key_exists($resourceId, $this->resources)) {
            return true;
        }

        if (!$this->resourceName->isSitesResourceId($resourceId)) {
            return false;
        }

        // @todo this can be made more efficient
        $resource = $this->getResource($resourceId);

        return ($resource !== null);
    }
806299
public function canHandle(\DOMNode $node, NodeInterface $target)
    {
        return
            strtolower($node->localName) == 'link' &&
            $node->namespaceURI == Atom10Standard::NAMESPACE_URI &&
            strtolower($node->attributes->getNamedItem('rel')->nodeValue) == 'enclosure' &&
            $target instanceof ItemInterface;
    }