-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Symfony Form inherit_data #34
Conversation
Could you show me what you want to do with inherit_data please? |
Hi @gilles-g, I want to reuse my Basically I found that we need to drop the See the folllowing code snippet. public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('order', OrderFilterType::class, [
'add_shared' => function (FilterBuilderExecuterInterface $qbe) {
$closure = function (QueryBuilder $filterBuilder, $alias, $joinAlias, Expr $expr) {
$filterBuilder->leftJoin(OrderTable::class, $joinAlias, Join::WITH, $alias . '.orderId = ' . $joinAlias . '.orderId');
};
$qbe->addOnce($qbe->getAlias().'.order', 'o', $closure);
}
])
->add('sample', SampleFilterType::class, [
'add_shared' => function (FilterBuilderExecuterInterface $qbe) {
$closure = function (QueryBuilder $filterBuilder, $alias, $joinAlias, Expr $expr) {
$filterBuilder->leftJoin(SampleTable::class, $joinAlias, Join::WITH, $alias . '.sampleId = ' . $joinAlias . '.sampleId');
};
$qbe->addOnce($qbe->getAlias().'.sample', 's', $closure);
}
])
->add('result', ResultFilterType::class, [
'inherit_data' => true
])
;
}
`` |
Ok thanks, Do you think you could add a test? |
Added an extra test while other tests are still working. |
Hi @gilles-g, |
sorry for the delay, I will merge and create tags |
No description provided.