User Query

Notice

We have attached an extra organization filter criteria to the native User Query (opens new window). You can utilize this param on any User Query (opens new window)

# Params

All of the standard User Query (opens new window) params are available plus the following:

Property Type Description
organization string (opens new window), string[] (opens new window), integer (opens new window), integer[] (opens new window), Organization, Organization[], null (opens new window) The organization criteria that the resulting users must have

Note

The organization criteria (above) can optionally accept three individual criteria:

{
    id: 1, // The organization identifier(s)
    organizationType: [1,2], // The organization type identifier(s)
    userType: [1,2] // The user type identifier(s)
}

# Chain Setting

All of the params above can be accessed and chained together. The methods are named the same as the property.

Here is an example:

::: code

{% set query = craft.organizations.users.getQuery() %}
{% do query.organization(1).firstName('Foo') %}
use flipbox\organizations\Organizations;

$query = Organizations::getInstance()->getUsers()->getQuery()
    ->organization(1)
    ->firstName('Foo');

:::