Application Packaging Standard

Last updated 18-Mar-2019

Retrieveing User info

The following example shows how to obtain information of all users of an account, both staff members and service users:

<?php
   ...
   $apsc = \APS\Request::getController();
   $apsc2 = $apsc->impersonate($this);
   $users = $apsc2->getResources('implementing(http://aps-standard.org/types/core/user/1.0)');
   foreach ($users as $user) {
                   $displayName = $user->displayName;
                   $login = $user->login;
                   $mail = $user->email;
                   ...
           }

To get only staff members, use http://aps-standard.org/types/core/admin-user/1.0 resource type.

To get only service users - http://aps-standard.org/types/core/service-user/1.0

Read more about user types.