Model/Attachment.php
public function getLinkForObject(AttachableObjectInterface $object, $fieldName = null)
    {
        return AttachmentLinkQuery::create()
            ->filterByAttachment($this)
            ->filterByAttachableObject($object)
            ->filterByModelField($fieldName)
            ->findOne()
        ;
    }
public function getLinkForObject(AttachableObjectInterface $object, $fieldName = null)
    {
        return AttachmentLinkQuery::create()
            ->filterByAttachment($this)
            ->filterByAttachableObject($object)
            ->filterByModelField($fieldName)
            ->findOne()
        ;
    }
public function getLinkForObject ( AttachableObjectInterface $ object , $ fieldName = null ) { return AttachmentLinkQuery :: create ( ) -> filterByAttachment ( $ this ) -> filterByAttachableObject ( $ object ) -> filterByModelField ( $ fieldName ) -> findOne ( ) ; }
Get the AttachmentLink for a specific attachable object and field name.

@param AttachableObjectInterface $object
@param string $fieldName

@return AttachmentLink
Get the AttachmentLink for a specific attachable object and field name .