public function hasLink( $link, &$linkDetail = null )
    {

        $links = $this->__get('links');

        if( isset($links[$link])) {
            $linkDetail = $links[$link];
            return $link;
        }

        foreach( $links as $via => $linkDetail ){
            if( in_array( $link, $linkDetail->foreignEntities ) ) {
                return $via;
            }
        }

        return false;

    }
public function hasLink( $link, &$linkDetail = null )
    {

        $links = $this->__get('links');

        if( isset($links[$link])) {
            $linkDetail = $links[$link];
            return $link;
        }

        foreach( $links as $via => $linkDetail ){
            if( in_array( $link, $linkDetail->foreignEntities ) ) {
                return $via;
            }
        }

        return false;

    }
public function hasLink ( $ link , & $ linkDetail = null ) { $ links = $ this -> __get ( 'links' ) ; if ( isset ( $ links [ $ link ] ) ) { $ linkDetail = $ links [ $ link ] ; return $ link ; } foreach ( $ links as $ via => $ linkDetail ) { if ( in_array ( $ link , $ linkDetail -> foreignEntities ) ) { return $ via ; } } return false ; }
Check if Entity has a named link

@param mixed $linkName or $foreignEntity
@param mixed $linkDetail - Link information
@return mixed
Check if Entity has a named link