app/Individual.php
public function findHighlightedMediaFile(): ?MediaFile
    {
        foreach ($this->facts(['OBJE']) as $fact) {
            $media = $fact->target();
            if ($media instanceof Media) {
                foreach ($media->mediaFiles() as $media_file) {
                    if ($media_file->isImage() && !$media_file->isExternal()) {
                        return $media_file;
                    }
                }
            }
        }

        return null;
    }
public function findHighlightedMediaFile(): ?MediaFile
    {
        foreach ($this->facts(['OBJE']) as $fact) {
            $media = $fact->target();
            if ($media instanceof Media) {
                foreach ($media->mediaFiles() as $media_file) {
                    if ($media_file->isImage() && !$media_file->isExternal()) {
                        return $media_file;
                    }
                }
            }
        }

        return null;
    }
public function findHighlightedMediaFile ( ) : ? MediaFile { foreach ( $ this -> facts ( [ 'OBJE' ] ) as $ fact ) { $ media = $ fact -> target ( ) ; if ( $ media instanceof Media ) { foreach ( $ media -> mediaFiles ( ) as $ media_file ) { if ( $ media_file -> isImage ( ) && ! $ media_file -> isExternal ( ) ) { return $ media_file ; } } } } return null ; }
Find the highlighted media object for an individual

@return MediaFile|null
Find the highlighted media object for an individual