public function getLinks($relation = null)
    {
        $links = $this->getAllLinks();
        if (null === $relation) {
            return $links;
        }
        foreach ($links as $key => $link) {
            if ($link->getRelation() !== $relation) {
                unset($links[$key]);
            }
        }

        return $links;
    }
public function getLinks($relation = null)
    {
        $links = $this->getAllLinks();
        if (null === $relation) {
            return $links;
        }
        foreach ($links as $key => $link) {
            if ($link->getRelation() !== $relation) {
                unset($links[$key]);
            }
        }

        return $links;
    }
public function getLinks ( $ relation = null ) { $ links = $ this -> getAllLinks ( ) ; if ( null === $ relation ) { return $ links ; } foreach ( $ links as $ key => $ link ) { if ( $ link -> getRelation ( ) !== $ relation ) { unset ( $ links [ $ key ] ) ; } } return $ links ; }
Return links.

@param string|null $relation If specified, return only links with this relation type.

@return Link[]

@since 1.0
Return links .