Formulize

Forms, workflows, and reporting. 100% free and open source.

Version 7.3 out now!How to installHow to update

Download .zip View on GitHub Join us on Slack Follow on Twitter

findAllUsersForEntries( (int | array) $entry_ids, (array) $scope_uids = array() )

Description

Finds the user ids of the creators of a given entry or entries. The scope can be limited to only certain users by passing an array of allowable user ids as the $scope_uids parameter.

Parameters

$user_ids - a entry id or array of entry ids
$scope_uids - Optional. an array of allowable user ids. Results will be limited to user ids that match one of the declared ids in the array.

Return Values

Returns an array of user ids, or false if the query failed.

Example

// find the users who created the declared series of entries in form 6
$form_id = 6;
$dataHandler = new formulizeDataHandler($form_id);
$entries = array(19, 20, 21);
$creation_user_ids = $dataHandler->findAllUsersForEntries($entries);
// find the users who created the declared series of entries in form 6
// only if the users are in the declared 'managers' array
$form_id = 6;
$dataHandler = new formulizeDataHandler($form_id);
$entries = array(19, 20, 21);
$managers = array(105, 121, 287);
$creation_user_ids = $dataHandler->findAllUsersForEntries($entries, $managers);