So, I just want to make a simple query for my voting extension that gives me all the votes with a certain discussion_id. Nothing complicated, but I'm struggling with it.
I've created a filter:
class VotesByDiscussionIdFilter implements FilterInterface
{
public function getFilterKey(): string
{
return 'discussionId';
}
public function filter(FilterState $filterState, string $filterValue, bool $negate): void
{
$filterState
->getQuery()
->where('discussion_id', '=', $filterValue);
}
}
in the extend.php file I've added:
(new Extend\Filter(HereShouldBeAFilterer?::class))
->addFilter(VotesByDiscussionIdFilter::class, 'mbl-featured-projects-votes')
Then this should also be implemented in the controller. I'm taking a look at the code mentioned in the documentation
here
And then there's also something called "Filterers" that I'm trying to find information on. This is probably where I'm stuck at the moment.
For something very simple, there's a lot to take in. It's probably just me not fully used to the platform yet.