• Resolved servantofchaos

    (@servantofchaos)


    This is a great plugin – but I am having trouble filtering a collection.

    I am pulling data from a Mentor requests table but want to only show the data when the mentor request number = 1.

    The following code generates a critical error but runs across all records when the addFilter modification is commented out.

    $assignQuery = new AirpressQuery(“Mentor requests”, CONFIG_NAME);
    $assignMentors = new AirpressCollection($assignQuery);
    $assignMentors -> addFilter(“{MRno} = ‘1’”);

    Where am I going wrong?

    TIA

Viewing 1 replies (of 1 total)
  • Thread Starter servantofchaos

    (@servantofchaos)

    Figured it out.
    It’s the query that has to be modified, not the collection.

    So it should be:
    $assignQuery = new AirpressQuery(“Mentor requests”, CONFIG_NAME);
    $assignQuery -> addFilter(“{MRno} = ‘1’”);
    $assignMentors = new AirpressCollection($assignQuery);

Viewing 1 replies (of 1 total)
  • The topic ‘AddFilter not working’ is closed to new replies.