protected function set($name, $link)
{
// from spec: aA link MUST be represented as either:
// - a string containing the link's URL.
// - an object ("link object") which can contain the following members:
if (!is_object($link) and !is_string($link)) {
throw new ValidationException('Link attribute has to be an object or string, "' . gettype($link) . '" given.');
}
if (is_string($link)) {
$this->container->set($name, strval($link));
return $this;
}
// Now $link can only be an object
$link_object = $this->manager->getFactory()->make('Link', [$this->manager, $this]);
$link_object->parse($link);
$this->container->set($name, $link_object);
return $this;
}