<commit_before><?php

namespace Mapbender\SearchBundle\Controller;

use FOM\CoreBundle\Component\ExportResponse;
use FOM\ManagerBundle\Configuration\Route;
use Mapbender\DataSourceBundle\Component\FeatureTypeService;
use Mapbender\SearchBundle\Component\QueryManager;
use Mapbender\SearchBundle\Entity\ExportRequest;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;

/**
 * Class ExportController
 *
 * @package Mapbender\SearchBundle\Controller
 * @author  <NAME> <<EMAIL>>
 * @Route("/export/")
 */
class ExportController extends MapbenderController
{


    /**@var FeatureTypeService */
    protected $featureService;

    /**@var QueryManager */
    protected $queryManager;


    /**
     *This method has desired services injected.
     *
     * @return string[]
     */
    protected function mappings()
    {
        return array(
            "featureService"  => static::MAPBENDER_FEATURE_SERVICE,
            "queryManager"    => static::MAPBENDER_QUERY_MANAGER,
            "securityContext" => static::MAPBENDER_SECURITY_CONTEXT
        );
    }

    /**
     * @Method("POST")
     * @param ExportRequest $request
     */
    public function export($request)
    {

        $features = $this->queryManager->listQueriesByFeatureType($this->featureService);

        return new ExportResponse($features, $request->getFilename(),
            $request->getType(), $request->getEncodingFrom(),
            $request->getEnclosure(), $request->getDelimiter(),
            $request->isEnableDownload());
    }

}<commit_msg>Fix call to querymanager to get feature ids<commit_after><?php

namespace Mapbender\SearchBundle\Controller;

use FOM\CoreBundle\Component\ExportResponse;
use FOM\ManagerBundle\Configuration\Route;
use Mapbender\DataSourceBundle\Component\FeatureTypeService;
use Mapbender\SearchBundle\Component\QueryManager;
use Mapbender\SearchBundle\Entity\ExportRequest;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;

/**
 * Class ExportController
 *
 * @package Mapbender\SearchBundle\Controller
 * @author  <NAME> <<EMAIL>>
 * @Route("/export/")
 */
class ExportController extends MapbenderController
{


    /**@var FeatureTypeService */
    protected $featureService;

    /**@var QueryManager */
    protected $queryManager;


    /**
     *This method has desired services injected.
     *
     * @return string[]
     */
    protected function mappings()
    {
        return array(
            "featureService"  => static::MAPBENDER_FEATURE_SERVICE,
            "queryManager"    => static::MAPBENDER_QUERY_MANAGER,
            "securityContext" => static::MAPBENDER_SECURITY_CONTEXT
        );
    }

    /**
     * @Method("POST")
     * @Route("export")
     * @param ExportRequest $request
     * @return ExportResponse
     */
    public function export($request)
    {

        $features = $this->queryManager->listQueriesByFeatureTypes($this->featureService, $request->getIds());

        return new ExportResponse($features, $request->getFilename(),
            $request->getType(), $request->getEncodingFrom(),
            $request->getEnclosure(), $request->getDelimiter(),
            $request->isEnableDownload());
    }

}
{'fraction_non_alphanumeric': 0.12299968622529024, 'fraction_numerical': 0.0, 'mean_word_length': 3.34924965893588, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 34, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5501566', 'n_tokens_mistral': 890, 'n_tokens_neox': 871, 'n_words': 155}