I'm getting this error:
LogicException: Unknown relation User accessed on xf_user_field_value in src/XF/Mvc/Entity/Finder.php at line 651
with the code below, is there something I have to do to define the relation? I was assuming that one just exists via user_id.
<?php
namespace Mileage...
That's it! got 10 lines so I'm getting something I can work with...
Thank you very much and also to everyone else that chimed in.. sorry if I was a bit dense at times...
Also tried this
return $usernames;
but get a server log erorr.
Object of class XF\Mvc\Entity\ArrayCollection could not be converted to string
src/XF/Template/Templater.php:1339
Ok, thanks but didn't make a difference..
<?php
namespace Mileage;
class Mileage{
public static function getMileage(){
$finder = \XF::finder('XF:User');
$usernames = $finder->limit(10)->pluckFrom('username')->fetch();
return;
}
}
I got rid of the join and just tried something as simple as possible based on the help docs so:
<?php
namespace Mileage;
class Mileage{
public static function getMileage(){
$finder = \XF::finder('XF:User');
$usernames = $finder->limit(10)->pluckFrom('username')->fetch();
}
}...