Set link

@param Link $link
354936
public function addLink(Link $link)
    {
        $name = $link->getName();

        if (isset($this->links[$name])) {
            throw new \LogicException(sprintf('A link name by "%s" is already exists.', $name));
        }

        $this->links[$name] = $link;
    }
861448
private function setCount(Link $link, $count): void
	{
		if (is_array($count)) {
			$link->setCount($count[0], $count[1]);
		} elseif (is_int($count)) {
			$link->setCount($count);
		} else {
			throw new InvalidArgumentException("Wrong argument 'count'");
		}
	}
397934
public function insertId($link = null)
    {
        is_null($link) && $link = $this->wlink;
        return $link->lastInsertId();
    }
1077435
public function setLink($link)
    {
        if (false === ValidatorTrait::validateLoc($link)) {
            throw new SitemapException('Value for setLink is not a valid URL');
        }

        $this->link = "<link>{$link}</link>";

        return $this;
    }
1060079
@SuppressWarnings("unchecked")
    @Internal
    protected final void setLinks(Map<String, Object> links) {
        for (Map.Entry<String, Object> entry : links.entrySet()) {
            String name = entry.getKey();
            Object value = entry.getValue();
            if (value instanceof Map) {
                Map<String, Object> linkMap = (Map<String, Object>) value;
                link(name, linkMap);
            }
        }
    }
353235
public function all(Link $link = null)
    {
        $data = $this->createData(array(
            'api_token' => $this->apiToken,
        ), $link);

        $this->send('yoall/', InternalRequestInterface::METHOD_POST, $data);
    }
201966
public function addLink(Link $link)
    {
        if ( ! $this->links instanceof ArrayIterator) {
            $this->links = new ArrayIterator();
        }

        $this->links->push($link);

        return $this;
    }
782299
protected function setLinkAttributes(Tag $tag, $linkInfo, $attrName)
	{
		$url   = trim($linkInfo);
		$title = '';
		$pos   = strpos($url, ' ');
		if ($pos !== false)
		{
			$title = substr(trim(substr($url, $pos)), 1, -1);
			$url   = substr($url, 0, $pos);
		}

		$tag->setAttribute($attrName, $this->text->decode($url));
		if ($title > '')
		{
			$tag->setAttribute('title', $this->text->decode($title));
		}
	}
255224
public function setLink($link)
    {
        if (strlen($link) == 0) {
            throw new \InvalidArgumentException(sprintf('Image link should not be empty'));
        }

        $this->link = $link;

        return $this;
    }
268215
public function setLinkPath($linkPath) {
        $this->linkPath = (substr($linkPath,0,1) != '/') ? '/'.$linkPath:$linkPath;
        if(substr($this->linkPath,-1) != '/') $this->linkPath .= '/';
    }
1128439
public function setUserAction($link, $label=null) {
	if ($label) {
		$this->userAction = [
			'link'  => $link,
			'label' => $label,
		];
	}
	else {
		$this->userAction = $link;
	}
}
795059
public void setLinkBean(CmsLinkBean link) {

        if (link == null) {
            link = new CmsLinkBean("", true);
        }
        m_textbox.setFormValueAsString(link.getLink());
        setInternal(link.isInternal());
    }
528072
public function setLink($link)
    {
        if ($this->version == Eresus_Feed_Writer::RSS2 || $this->version == Eresus_Feed_Writer::RSS1)
        {
            $this->addElement('link', $link);
        }
        else
        {
            $this->addElement('link', '', array('href' => $link));
            $this->addElement('id', Eresus_Feed_Writer::uuid($link, 'urn:uuid:'));
        }

    }
240386
public function setLinks(array $links)
    {
        $this->links = new ArrayIterator();

        foreach ($links as $linkIdent => $link) {
            $this->addLink($linkIdent, $link);
        }

        return $this;
    }
899017
public function click(Link $link)
    {
        if ($link instanceof Form) {
            return $this->submit($link);
        }

        return $this->request($link->getMethod(), $link->getUri());
    }
558912
public function clickLinkInHeader(string $link)
    {
        $header_link = $this->find('css', '.page-title-action');

        if ($header_link->getText() === $link) {
            $header_link->click();
        } else {
            $this->getHeaderElement()->clickLink($link);
        }
    }
524971
public function updateLink(&$link, &$action, &$relativeLink)
    {
        // Get appropriate locale for this record
        $localeObj = $this->getRecordLocale();
        if (!$localeObj) {
            return;
        }

        // Don't rewrite outside of domain mode
        $domain = $localeObj->getDomain();
        if (!$domain) {
            return;
        }

        // Don't need to prepend domain if on the same domain
        if (FluentState::singleton()->getDomain() === $domain->Domain) {
            return;
        }

        // Prefix with domain
        $link = Controller::join_links($domain->Link(), $link);
    }