Ryan

Hi Folks, has anyone upgraded silverstripe from 3.6.6 to 4.4.1 or 4.1 ?

wmk

As you already have an ArrayList, why not search the ArrayList by callback?

Philipp

So you mean i should use the filterByCallback Method?

wmk

yes. I dunno if search filters work with ArrayLists.

wmk

ArrayListTest doesn't use search filter modifiers.. https://github.com/silverstripe/silverstripe-framework/blob/4/tests/php/ORM/ArrayListTest.php

Show 1 attachment(s)
GitHub  
silverstripe/silverstripe-framework

SilverStripe Framework, the MVC framework that powers SilverStripe CMS - silverstripe/silverstripe-framework

Hide attachment content
wmk

DataListTest does, so it doesn't seem to be supported

wmk

Good catch, I thought it should work

wmk

And the related issue: https://github.com/silverstripe/silverstripe-framework/issues/5911

Show 1 attachment(s)
GitHub  
ArrayList's and comparison filters · Issue #5911 · silverstripe/silverstripe-framework

Request for enhancement to ArrayList originally discussed in (and subsequently taken from) core dev DL and setup as an issue here for tracking. It appears that array lists do not actually utilize f...

Hide attachment content
Philipp

Hmm okay, it seems that this solution have a lower performance. I’m doing some code optimizations, so i will try to filter the companies in my API call first.

Thanks for help 🙂


Show less replies
wmk

It seems, that PartialMatch is for Like '%Foo' DB queries, so it won't work on ArrayLists?

wmk

and what's your search term @Philipp?

Philipp

My searchTerm is a string from an input field

Philipp

Hey, Can someone help me out with SearchFilter Modifiers? I’m fetching Companies from an API and I want to filter them via “PartialMatch”

null

sometimes you just need to talk out loud and type it into Slack

kinglozzer

> onBeforeWrite when a record is added to the join table Isn’t that just an onBeforeWrite() in your ‘through’ class?