public function getLink($relation)
    {
        $links = $this->getAllLinks();
        foreach ($links as $link) {
            if ($link->getRelation() === $relation) {
                return $link;
            }
        }

        return null;
    }
public function getLink($relation)
    {
        $links = $this->getAllLinks();
        foreach ($links as $link) {
            if ($link->getRelation() === $relation) {
                return $link;
            }
        }

        return null;
    }
public function getLink ( $ relation ) { $ links = $ this -> getAllLinks ( ) ; foreach ( $ links as $ link ) { if ( $ link -> getRelation ( ) === $ relation ) { return $ link ; } } return null ; }
Return single link.

@param string $relation Return first link with this relation type.

@return Link|null

@since 1.0
Return single link .