Column-based Propel Filtering?

How do I filter based on concatenated table columns in Propel?

how

$results = FooQuery::create()->joinBar()->filterByBarSurname('surname'); 
+4
source share
1 answer

You should use the use method as described in the document :

 $results = FooQuery::create() ->useBarQuery() ->filterBySurname('surname') ->endUse() ->find(); // example Query generated for a MySQL database $query = 'SELECT foo.* from foo INNER JOIN bar ON foo.BAR_ID = bar.ID WHERE bar.SURNAME = :p1'; // :p1 => 'surname' 

If you should use join() , I don't think you can use the filterByXXX method, but the old where :

 $results = FooQuery::create() ->join('Foo.Bar') ->where('Bar.surname = ?', 'surname') ->find(); 
+7
source

All Articles