Hal\Link::toArray PHP Method

toArray() public method

public toArray ( ) : array
return array
    public function toArray()
    {
        $href = $this->getHref();
        if (empty($href)) {
            return array();
        }
        $link = array('href' => $href);
        if ($this->getTitle()) {
            $link['title'] = $this->getTitle();
        }
        if ($this->getTitle()) {
            $link['title'] = $this->getTitle();
        }
        if ($this->getName()) {
            $link['name'] = $this->getName();
        }
        if ($this->getHreflang()) {
            $link['hreflang'] = $this->getHreflang();
        }
        if ($this->getTemplated()) {
            $link['templated'] = $this->getTemplated();
        }
        return $link;
    }