- ⌂ repo
- Methods
- Constructor
- execute()
- get()
- get_content_type()
- get_first()
- get_object()
- get_object_by_id()
- get_object_by_oid()
- get_object_by_doid()
- get_object_by_uuid()
- get_objects_by_id()
- get_objects_by_oid()
- get_objects_by_doid()
- get_objects_by_uuid()
- get_root()
- get_row()
- get_rows()
- get_system_property()
- log_alert()
- log_critical()
- log_to_file()
- log_to_html()
- new_collection()
- new_object()
- peek_user()
- pop_user()
- push_super_user()
- push_user()
- query()
- supports_dimensions()
- switch_user()
- uninit()
- with()
repo::pop_user()
Pop users from the repository user stack until the index passed in is reached, which is typically the index returned by switch_user(), push_super_user() and push_user() so that it will return the repository user and stack to their state before they were called.
Prototype
User pop_user(integer $index)
Parameter
- index - The index into the stack of the user that should become the repository user. This should typically be the index returned by switch_user(), push_super_user() and push_user() to return the repository user and stack to their state before they were called.
Return
The new repository User is returned on success. Otherwise FALSE is returned, which will happen if an invalid index is provided.
Example
$user = $repo->get_first("FROM User WHERE OID=123");
// switch the "user of record" to user with OID 123
$index = $repo->push_user($user);
if($index == FALSE) {
exit("Could not push user.");
}
// get all contacts user with OID 123 can view
$contacts = $repo->get("SELECT Name FROM Contact");
foreach($contacts as $contact) {
echo($contact->Name . "\n");
}
// return to previous "user of record"
$repo->pop_user($index);