Giter Site home page Giter Site logo

Comments (4)

g4b0 avatar g4b0 commented on July 18, 2024

@muskie9 what do you think about that? It seems reasonable, isn't it?

from silverstripe-searchable-dataobjects.

muskie9 avatar muskie9 commented on July 18, 2024

I think that's fine for the example code. I would suggest though that if you aren't going to be running anything in the closure other than return true; to not include getSearchFilterByCallback() on the object as it may have unintended results since it's a hard true.

from silverstripe-searchable-dataobjects.

HARVS1789UK avatar HARVS1789UK commented on July 18, 2024

Hi @muskie9

Agreed, now that I have read through the code and seeing a check is made to see if the method exists I could just as easily remove the getSearchFilterByCallback() method from my DataObject (which I will probably do).

Just thought I would raise the potential time saver in the example code in README.md as I expect that many users of the module will (like me) be lazy and copy the example code to get the module up and running ASAP and many of them may also spend some time wondering why their DO's are still not showing up in search. Up to you guys if you want to make the change or not, just thought id suggest it.

Kind regards,

HARVS1789UK

from silverstripe-searchable-dataobjects.

muskie9 avatar muskie9 commented on July 18, 2024

I think it's a good suggestion, probably a good idea to describe filterByCallback() usage a bit as well. I started looking around the SilverStripe docs but there's nothing in there that I could find for that filter type. Only a single example in the API.

from silverstripe-searchable-dataobjects.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.