I'm looking for a way to automatically load all streams from a product when loading a product (product/category page) but can't seem to find a way to add this. I could add it as an extended attribute, but I would rather make use of the $product->getStreams() function.
I've tried the following but I couldn't figure out how to add an association through this method:
public static function getSubscribedEvents(): array
{
return [
ProductEvents::PRODUCT_LOADED_EVENT => 'onLoad'
];
}
public function onLoad(EntityLoadedEvent $event): void
{
$product = $event->getEntities();
}