PHP Class Sulu\Bundle\MediaBundle\Search\Subscriber\MediaSearchSubscriber

Inheritance: implements Symfony\Component\EventDispatcher\EventSubscriberInterface
Show file Open project: sulu/sulu

Protected Properties

Property Type Description
$factory Massive\Bundle\SearchBundle\Search\Factory
$logger Psr\Log\LoggerInterface
$mediaManager Sulu\Bundle\MediaBundle\Media\Manager\MediaManagerInterface
$searchImageFormat string The format of the image, which will be returned in the search.
$thumbnailMimeTypes array

Public Methods

Method Description
__construct ( Sulu\Bundle\MediaBundle\Media\Manager\MediaManagerInterface $mediaManager, Massive\Bundle\SearchBundle\Search\Factory $factory, Psr\Log\LoggerInterface $logger, $thumbnailMimeTypes, $searchImageFormat )
getSubscribedEvents ( )
handlePreIndex ( Massive\Bundle\SearchBundle\Search\Event\PreIndexEvent $event ) Adds the image to the search document.

Private Methods

Method Description
getImageUrl ( $media, $locale ) Return the image URL for the given media.

Method Details

__construct() public method

public __construct ( Sulu\Bundle\MediaBundle\Media\Manager\MediaManagerInterface $mediaManager, Massive\Bundle\SearchBundle\Search\Factory $factory, Psr\Log\LoggerInterface $logger, $thumbnailMimeTypes, $searchImageFormat )
$mediaManager Sulu\Bundle\MediaBundle\Media\Manager\MediaManagerInterface
$factory Massive\Bundle\SearchBundle\Search\Factory Massive search factory
$logger Psr\Log\LoggerInterface
$thumbnailMimeTypes
$searchImageFormat

getSubscribedEvents() public static method

public static getSubscribedEvents ( )

handlePreIndex() public method

Adds the image to the search document.
public handlePreIndex ( Massive\Bundle\SearchBundle\Search\Event\PreIndexEvent $event )
$event Massive\Bundle\SearchBundle\Search\Event\PreIndexEvent

Property Details

$factory protected property

protected Factory,Massive\Bundle\SearchBundle\Search $factory
return Massive\Bundle\SearchBundle\Search\Factory

$logger protected property

protected LoggerInterface,Psr\Log $logger
return Psr\Log\LoggerInterface

$mediaManager protected property

protected MediaManagerInterface,Sulu\Bundle\MediaBundle\Media\Manager $mediaManager
return Sulu\Bundle\MediaBundle\Media\Manager\MediaManagerInterface

$searchImageFormat protected property

The format of the image, which will be returned in the search.
protected string $searchImageFormat
return string

$thumbnailMimeTypes protected property

protected array $thumbnailMimeTypes
return array