Created
March 27, 2018 08:59
-
-
Save evgeniy1204/d4fb5752e58496f3f8d2d77bc9d07fa8 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 | |
->add('ride', 'filter_collection_adapter', array( | |
'type' => new BookingOptionalRideToFilterType(), | |
'label' => 'Corsa', | |
'add_shared' => function (FilterBuilderExecuterInterface $qbe) { | |
$closure = function (QueryBuilder $filterBuilder, $alias, $joinAlias, Expr $expr) { | |
$filterBuilder->leftJoin('AppBundle:RideSelector', 'rideSelector', 'WITH', 'rideSelector.object_class = \'AppBundle\Entity\BookingOptional\''); | |
$filterBuilder->leftJoin('AppBundle:Ride', 'ride', 'WITH', 'ride.id IN (rideSelector.ride_tags)'); | |
}; | |
// then use the query builder executor to define the join, the join's alias and things to do on the doctrine query builder. | |
$qbe->addOnce($qbe->getAlias().'.ride', 'ride', $closure); | |
}, | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment