smozgur
Well-known member
This is how I would query threads by the solution post's user id in a controller action:
However, I need to refer to the
Basically I would like to use a field name as the criteria. Using custom SQL query is perfectly fine, but I am just curious if this is possible with the Finder instead of using custom SQL?
Thanks.
PHP:
$finder = $this->finder('XF:Thread');
$finder->where('Question.solution_user_id', 123);
However, I need to refer to the
xf_thread.user_id
field in the table instead of using a scalar or array (123 in the sample) to retrieve the threads that users marked their own posts as the solution. Following obviously doesn't work, but just to demonstrate what I am looking for:
PHP:
$finder->where('Question.solution_user_id', 'user_id');
Basically I would like to use a field name as the criteria. Using custom SQL query is perfectly fine, but I am just curious if this is possible with the Finder instead of using custom SQL?
Thanks.