Last active
April 29, 2019 13:53
-
-
Save MarioBlazek/22a8a285336f17e09febb42f52dad54b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace AppBundle\Controller; | |
use AppBundle\Queries\LatestRelatedRecipes; | |
use Netgen\Bundle\EzPlatformSiteApiBundle\Controller\Controller; | |
use Netgen\Bundle\EzPlatformSiteApiBundle\View\ContentView; | |
class FullViewController extends Controller | |
{ | |
public function viewRecipe(ContentView $view) | |
{ | |
$queryType = $this->get('ezpublish.query_type.registry') | |
->getQueryType(LatestRelatedRecipes::getName()); | |
$query = $queryType->getQuery([ | |
'recipe_content_id' => $view->getSiteContent()->id, | |
'limit' => 4, | |
]); | |
$recipies = $this->getSite() | |
->getFilterService() | |
->filterLocations($query); | |
$view->addParameters([ | |
'recipies' => $this->extractValueObjects($recipies), | |
]); | |
return $view; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment