Reputation: 1183
I have the code below adding a custom filter of a non-related model below but I cannot get it to filter. Can anyone point me to the right direction?
public function addLanguagesColumnQuery($query, $field, $value)
{
$rootAlias = $query->getRootAlias();
$query->andWhereIn($rootAlias.'.journalist_id IN (SELECT journalist_id FROM journalist_language where language_id IN ('.implode(",", array_filter($value, 'strlen')).')');
return $query;
}
Upvotes: 1
Views: 244
Reputation: 22756
What is your schema?
I think the problem come from the table name you use for the subquery. You should use the doctrine name instead of the one inside the database.
So try to use JournalistLanguage
(or the one defined inside your schema) instead of journalist_language
.
Upvotes: 1