AndyB
Well-known member
I'm trying to create a finder which searches the xf_post table.
The following $conditions variable:
The finder:
Why am I getting the following error message?
Thank you.
The following $conditions variable:
PHP:
$nodeRepo = $this->repository('XF:Node');
$nodes = $nodeRepo->getNodeList();
$nodeIds = $nodes->keys();
foreach ($nodeIds AS $k => $v)
{
$conditions[] = ['xf_thread.node_id', '=', $v];
}
The finder:
PHP:
$finder = \XF::finder('XF:Post');
$posts = $finder
->with('Thread')
->where('message', 'LIKE', $finder->escapeLike($keywords, '%?%'))
->where('message_state', '=', 'visible')
->whereOr($conditions)
->order('post_id', 'DESC')
->limit($limit)
->fetch();
Why am I getting the following error message?
HTML:
LogicException: Unknown relation XF:Thread accessed on xf_post in src/XF/Mvc/Entity/Finder.php at line 630
Thank you.