Skip to content

Instantly share code, notes, and snippets.

@rileyrg
Created June 1, 2017 10:23
Show Gist options
  • Save rileyrg/24028dbc2fcf9a5d60ba516812c661d5 to your computer and use it in GitHub Desktop.
Save rileyrg/24028dbc2fcf9a5d60ba516812c661d5 to your computer and use it in GitHub Desktop.
$personForm = $this->createForm(PersonFilterType::class, null, [
'action' => $resetLink,
'method' => 'GET'
]);
if ($request->query->has($personForm->getName())) {
if (!$personForm->get('reset')->isClicked()) {
$personForm->submit($request->query->get($personForm->getName()));
}else{
$request->query->remove($request->query->get($personForm->getName()));
}
$qb_updater = $this->get('lexik_form_filter.query_builder_updater');
// tell the query updater about the joins on the queryBuilder using setparts. no need for add_shared in the FilterType
$qb_updater->setParts(array(
'__root__' => 'p',
'p.adressData' => 'a',
'p.adminAdressData' => 'aa',
'p.eyeColor' => 'e'
));
$qb_updater->addFilterConditions($personForm, $queryB);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment