<?php

namespace Internetgalerie\IgDatapoolFe\ViewHelpers\Widget;

/**
 * Renders a ABC list
 */
class AbcnateViewHelper extends \TYPO3\CMS\Fluid\Core\Widget\AbstractWidgetViewHelper
{
    /**
     * @var \Internetgalerie\IgDatapoolFe\ViewHelpers\Widget\Controller\AbcnateController
     */
    protected $controller;

    /**
     * @param \Internetgalerie\IgDatapoolFe\ViewHelpers\Widget\Controller\AbcnateController $controller
     */
    public function injectController(\Internetgalerie\IgDatapoolFe\ViewHelpers\Widget\Controller\AbcnateController $controller)
    {
        $this->controller = $controller;
    }

    /**
     * @param  \TYPO3\CMS\Extbase\Persistence\QueryResultInterface $objects
     * @param  string                                              $property
     * @param  string                                              $as
     * @return string
     */
    public function render(\TYPO3\CMS\Extbase\Persistence\QueryResultInterface $objects, $property, $as, array $configuration = array('insertAbove' => false, 'insertBelow' => true))
    {
        $this->controller->setParentRequest($this->renderingContext->getRequest());
        return $this->initiateSubRequest();
    }
}
