Skip to content

Commit

Permalink
fixed php 5.6 incompatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Simonas Šerlinskas committed Sep 19, 2016
1 parent 60736e5 commit 19ad974
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Controller/ProfilesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,12 @@ public function getAllProfilesAction()
/** @var Repository $repo */
$repo = $this->get($this->getParameter('ongr_settings.repo'));

$search = $repo->createSearch();
$search->addAggregation(new TermsAggregation('profiles', 'profile'));

/** @var DocumentIterator $result */
$result = $repo->execute(
($repo->createSearch())->addAggregation(new TermsAggregation('profiles', 'profile'))
);
$result = $repo->execute($search);

/** @var AggregationValue $agg */
foreach ($result->getAggregation('profiles') as $agg) {
$profiles[] = $agg->getValue('key');
Expand Down

0 comments on commit 19ad974

Please sign in to comment.