/**
  * @param string $relationshipName
  * @param array  $description
  * @param bool   $isShowSelf
  * @param bool   $isShowRelated
  *
  * @return array <string,LinkInterface>
  */
 protected function readLinks($relationshipName, array $description, $isShowSelf, $isShowRelated)
 {
     $links = $this->getValue($description, self::LINKS, []);
     if ($isShowSelf === true && isset($links[LinkInterface::SELF]) === false) {
         $links[LinkInterface::SELF] = $this->factory->createLink(DocumentInterface::KEYWORD_RELATIONSHIPS . '/' . $relationshipName);
     }
     if ($isShowRelated === true && isset($links[LinkInterface::RELATED]) === false) {
         $links[LinkInterface::RELATED] = $this->factory->createLink($relationshipName);
     }
     return $links;
 }
Exemple #2
0
 /**
  * @param string     $subHref
  * @param null|mixed $meta
  * @param bool       $treatAsHref
  *
  * @return LinkInterface
  */
 protected function createLink($subHref, $meta = null, $treatAsHref = false)
 {
     return $this->factory->createLink($subHref, $meta, $treatAsHref);
 }