Organization Query

The Organization Query supports all Element Query (opens new window) operations plus the following:

# Params

Property Type Description
state string (opens new window), string[] (opens new window), null (opens new window) The organization's state (custom defined)
user string (opens new window), string[] (opens new window), integer (opens new window), integer[] (opens new window), User (opens new window), User[] (opens new window), null (opens new window) The user(s) that result' users must be associated to
userGroup string (opens new window), string[] (opens new window), integer (opens new window), integer[] (opens new window), User Group (opens new window), User Group[] (opens new window), null (opens new window) The user group(s) that the result's users must be assigned to
userType string (opens new window), string[] (opens new window), integer (opens new window), integer[] (opens new window), User Type, User Type[], null (opens new window) The user type(s) that the result's users must be associated with
organizationType string (opens new window), string[] (opens new window), integer (opens new window), integer[] (opens new window), Organization Type, Organization Type[], null (opens new window) The the organization type(s) that the result's must be associated to
dateJoined string (opens new window), DateTime (opens new window), null (opens new window) The date the organization joined

# 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.elements.getQuery() %}
{% do query.state('foo').user(currentUser) %}
use flipbox\organizations\Organizations;

$query = Organizations::getInstance()->getOrganizations()->getQuery()
    ->state('foo')
    ->user(\Craft::$app->getUser()->getIdentity());

:::