What is the replacement for this deprecated method, or how do we go about filtering like this now? I can’t seem to find anything appropriate. Looking at the v9rc3 page list block controller we’re still doing this:
@mnakalay I’m all over those Page List Methods like a fly on a turd at the moment. Looking around, it appears we need to use the $list->getQueryObject() method for this now, as mentioned here: Searching and Sorting with the PageList object, under Advanced Techniques. Although I haven’t tested it yet, it appears to be the new goto! Other than that, there seems to be no other, yet obvious, way to do it…
I’m not sure you really need that. Those are all methods belonging to the class so if you have an instance of your PageList you should be able to do $pageList->filterBySmellOfTurd() and it should work without requesting the query object.
But that’s not tested either so you’ll still have to test it all.
@mnakalay Correct, and I understand how the shortened methods work. I’ve stuck to using the filterByAttribute() approach. In this case, trying to feed the filterBy methods ‘cvName’ is not working, as it’s a db field, rather than the attribute handle filterBy is looking for.
What I’m aiming to do is filter a list by the current page id/object to remove it, without the need to run another loop on the pages array after its created. So, in my use case:
I am not at my desk at the moment, so cant provide details. There should be an equivalent method for implementing similar. Also, as the list is on a complex join of tables, you may need to specify the table as well as the column to filter on.
I’ve also checked \Concrete\Core\Search\ItemList\Database\ItemList, where it’s also marked as deprecated, to no avail. This isn’t make or break by any means. I was just hoping there was another obvious replacement way to do this!