Organization

You may access the following public properties and methods on an Organization Element.

Public Properties

All of the standard Element public properties are available plus the following:

PropertyTypeDescription
statestring, nullThe organization's state (custom defined)
dateJoinedDateTime, nullThe date the organization joined

Public Methods

All of the standard Element public methods are available plus the following:

getUsers( $criteria = [] )

Returns: User Query

ArgumentAcceptsDescription
$criteriaarrayUser Query criteria
{# Get an Organization Type #}
{% set element = craft.organizations.elements.find('flipbox') %}
{% set users = element.getUsers({status: null}).all() %}
<ul>
{% for user in users %}
    <li>{{ user.id }} - {{ user.getFullName() }}</li>
{% endfor %}
</ul>

getTypes( $criteria = [] )

Returns: Organization Type Query

ArgumentAcceptsDescription
$criteriaarrayOrganization Type Query criteria
{# Get an Organization Type #}
{% set element = craft.organizations.elements.find('flipbox') %}
{% set users = element.getTypes({status: null}).all() %}
<ul>
{% for type in types %}
    <li>{{ type.id }} - {{ type.name }}</li>
{% endfor %}
</ul>

getType( $identifier )

Returns: Organization Type, null

ArgumentAcceptsDescription
$identifierstring, integer, nullOrganization Type criteria
{# Get an Organization Type #}
{% set element = craft.organizations.elements.find('flipbox') %}
{% set type = element.getType('technology') %}
<p>{{ type.id }} - <strong>{{ type.name }}</strong></p>

getPrimaryType()

Returns: Organization Type, null

{# Get an Organization Type #}
{% set element = craft.organizations.elements.find('flipbox') %}
{% set type = element.getPrimaryType() %}
<p>{{ type.id }} - <strong>{{ type.name }}</strong></p>

getActiveType()

Returns: Organization Type, null

{# Get an Organization Type #}
{% set element = craft.organizations.elements.find('flipbox') %}
{% set type = element.getActiveType() %}
<p>{{ type.id }} - <strong>{{ type.name }}</strong></p>