Set the secondary menu links.

@param  string       $linkIdent The link identifier.
@param  array|object $link      The link object or structure.
@throws InvalidArgumentException If the link is invalid.
@return self
556993
public function addLink($linkIdent, $link)
    {
        if (!is_string($linkIdent) && !is_numeric($linkIdent)) {
            throw new InvalidArgumentException(
                'Link identifier must be a string or '
            );
        }

        if (is_array($link)) {
            $active = true;
            $name   = null;
            $url    = null;
            $permissions = [];

            if (isset($link['ident'])) {
                $linkIdent = $link['ident'];
            } else {
                $link['ident'] = $linkIdent;
            }

            if (isset($link['active'])) {
                $active = !!$link['active'];
            }

            if (isset($link['name'])) {
                $name = $this->translator()->translation($link['name']);
            }

            if (isset($link['url'])) {
                $url = $this->translator()->translation($link['url']);
            }

            if (isset($link['required_acl_permissions'])) {
                $permissions = $link['required_acl_permissions'];
            }

            if ($name === null && $url === null) {
                return $this;
            }

            $this->links[$linkIdent] = [
                'active'   => $active,
                'name'     => $name,
                'url'      => $url,
                'selected' => $this->isCurrentItem([ $linkIdent, (string)$url ]),
                'required_acl_permissions' => $permissions
            ];
        } else {
            throw new InvalidArgumentException(sprintf(
                'Link must be an associative array, received %s',
                (is_object($link) ? get_class($link) : gettype($link))
            ));
        }

        return $this;
    }
215288
public function addAboutLink(Link $link)
    {
        if ($link->getName() !== 'about') {
            throw new \Exception('Error Objects only support "about" links');
        }

        $this->links->addLink($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'");
		}
	}
1081788
public function addLink(Link $link)
    {
        $this->links[] = $link;
        $this->eventHandler->linkAdded($this, $link);
    }
1367552
public function setBaseUrl(string $name, string $link): void
	{
		$this->baseUrl = new \stdClass;
		$this->baseUrl->name = $name;
		$this->baseUrl->link = $link;
	}
763611
public function symlink($target, $link)
    {
        if (!file_exists($target)) {
            throw new \InvalidArgumentException('Target not found: ' . $target);
        }
        if ($this->relative) {
            $target = $this->makePathRelative($target, dirname($link));
        }
        $this->fs->symlink($target, $link, $this->copyOnWindows);
    }
1202968
public function addLinkGeneratorItem(\Tecnocreaciones\Bundle\ToolsBundle\Model\LinkGenerator\LinkGeneratorItemInterface $linkGeneratorItem) {
        $linkGeneratorItem->setLinkGeneratorService($this);
        $this->linkGeneratorItems[] = $linkGeneratorItem;
        return $this;
    }
544913
public function withSuffixLink(InternalNode $link_target): self
    {
        if ($this->suffix_link !== null) {
            throw new \Exception("Trying to link node more than once.");
        }
        $this->suffix_link = $link_target;

        return $this;
    }
146473
public function addLink(Link $link)
    {
        if (!$this->links) {
            $this->links = [];
        }
        $this->links[] = $link;
    }
385586
public function linkAdded(Span $span, Link $link)
    {
        // If the span is already attached (managed by the extension), then
        // tell the extension to add the link.
        if ($span->attached()) {
            $this->addLink($link->traceId(), $link->spanId(), [
                'type' => $link->type(),
                'attributes' => $link->attributes(),
                'span' => $span
            ]);
        }
    }
1092607
public function linkColumn($identifier, $options = [], $callback)
    {
        $column = new LinkColumn($identifier, $options, $callback);
        $this->columns->put($identifier, $column);

        return $this;
    }
225792
protected function processSymlink(string $target, $linkData)
    {
        $link = $this->getLink($linkData);

        if (!$link) {
            throw new InvalidArgumentException('No link passed in config');
        }

        if (!$target) {
            throw new InvalidArgumentException('No target passed in config');
        }

        if ($this->fileSystem->isAbsolutePath($target)) {
            throw new InvalidArgumentException(
                sprintf('Invalid symlink target path %s. It must be relative', $target)
            );
        }

        if ($this->fileSystem->isAbsolutePath($link)) {
            throw new InvalidArgumentException(
                sprintf('Invalid symlink link path %s. It must be relative', $link)
            );
        }

        $currentDirectory = realpath(getcwd());
        $targetPath = realpath($currentDirectory . DIRECTORY_SEPARATOR . $target);
        $linkPath = $currentDirectory . DIRECTORY_SEPARATOR . $link;

        if (!is_dir($targetPath) && !is_file($targetPath)) {
            if ($this->getConfig(static::SKIP_MISSED_TARGET, $link)) {
                return null;
            }
            throw new InvalidArgumentException(
                sprintf('The target path %s does not exists', $targetPath)
            );
        }

        try {
            $this->fileSystem->ensureDirectoryExists(\dirname($linkPath));
        } catch (\RuntimeException $exception) {
            throw new LinkDirectoryError($exception->getMessage(), $exception->getCode(), $exception);
        }

        if (is_link($linkPath) && realpath(readlink($linkPath)) === $targetPath) {
            $this->event->getIO()->write(
                sprintf(
                    '  Symlink <comment>%s</comment> to <comment>%s</comment> already created',
                    $target,
                    $link
                )
            );
            return null;
        }

        return (new Symlink())
            ->setTarget($targetPath)
            ->setLink($linkPath)
            ->setAbsolutePath($this->getConfig(static::ABSOLUTE_PATH, $linkData, false))
            ->setForceCreate($this->getConfig(static::FORCE_CREATE, $linkData, false));
    }
120568
public function addLink(string $name, string $link = null, array $arguments = [], int $position = null): Link
	{
		/* @var $item Link */
		$item = $this->addItem(new Link($name, $link, $arguments), $position);
		return $this->getMenu()->attachLink($item);
	}
638150
function setNextMapIdent($ident, $multicall = false)
    {
        if (!is_string($ident)) {
            throw new InvalidArgumentException('ident = ' . print_r($ident, true));
        }

        return $this->execute(ucfirst(__FUNCTION__), array($ident), $multicall);
    }
886484
public function addLinksArray($key, LinksArray $linksArray) {
		Validator::checkMemberName($key);
		
		if (isset($this->links[$key])) {
			throw new DuplicateException('link with key "'.$key.'" already set');
		}
		
		$this->links[$key] = $linksArray;
	}
763740
public function menuLinkDependency($title, $link, $translations, $destBid, $weight = 0, $menu = 'main') {
    $menu_link_content = $this->entityManager->getStorage('menu_link_content')->create([
      'title' => $title,
      'link' => ['uri' => 'internal:/node/' . $destBid[0]],
      'menu_name' => (!empty($translations)) ? $menu . '-fr' : $menu,
      'langcode' => (!empty($translations)) ? 'fr' : 'en',
      'parent' => $link,
      'weight' => $weight,
    ]);
    $menu_link_content->save();
    $this->database->update('menu_link_content_data')
      ->fields(['link__uri' => 'entity:node/' . $destBid[0]])
      ->condition('id', $menu_link_content->id())
      ->execute();
    return $menu_link_content;
  }
358313
public function setIdentifier($identifier)
    {
        if (is_string($identifier)) {
            $this->identifier = $identifier;
        } else {
            throw new \InvalidArgumentException(
                "Invalid type '" . gettype($identifier). "' for argument 'identifier' given."
            );
        }
    }