Snog
Well-known member
- Affected version
- 2.1
Take this example where 687 is a non-existent category ID:
Will always return
Code:
$mediaItemFinder = $this->finder('XFMG:MediaItem')
->where([
'category_id' => 687
]);
$mediaIds = $mediaItemFinder->pluckFrom('media_id')->fetch(1000);
if(!$mediaIds)
{
echo 'Nope'; die();
}
else
{
print_r($mediaIds); die();
}
Will always return
XF\Mvc\Entity\ArrayCollection Object ( [entities:protected] => Array ( ) [populated:protected] => 1 )