I have custom data for events that is not visible to anonymous users (it's for internal use only).
I want to access that data from my implementation of hook_civicrm_post().
When I call the API "get" from within the hook, the API doesn't return this custom data, since it's protected.
I guess I want my implementation of the hook to run as if it's a logged in user. How do I do that within the hook, but not in a way that opens up visibility once the hook completes running?
Here's a cut-down sample of my code, where 'custom_25' is the custom field which is not returned as part of $event ...
function xxxxxx_civicrm_post( $op, $objectName, $id, &$params )
{
if ($objectName == 'Participant') {
switch ($op) {
case 'create':
$event = civicrm_api3('Event', 'get', array(
'sequential' => 1,
'return' => 'custom_25',
'id' => $params->event_id,
));
break;
}
}
}
function xxxxxx_civicrm_post( $op, $objectName, $id, &$params ) { if ($objectName == 'Participant') { switch ($op) { case 'create': $event = civicrm_api3('Event', 'get', array( 'sequential' => 1, 'return' => 'custom_25', 'id' => $params->event_id, )); break; } } }