Elcodi\Store\ProductBundle\Controller\PurchasableController::relatedAction PHP Метод

relatedAction() публичный Метод

Purchasable related view
public relatedAction ( $id ) : array
Результат array
    public function relatedAction($id)
    {
        $purchasable = $this->get('elcodi.repository.purchasable')->find($id);
        if (!$purchasable instanceof PurchasableInterface) {
            throw new EntityNotFoundException('Purchasable not found');
        }
        $relatedProducts = $this->get('elcodi.related_purchasables_provider')->getRelatedPurchasables($purchasable, 3);
        return $this->renderTemplate('Modules:_purchasable-related.html.twig', ['purchasables' => $relatedProducts]);
    }