You are here

function views_plugin_argument_default_contact_id_from_user::get_argument in CRM Core 7

Return the default argument.

This needs to be overridden by every default argument handler to properly do what is needed.

Overrides views_plugin_argument_default::get_argument

File

modules/crm_core_user_sync/views/views_plugin_argument_default_contact_id_from_user.inc, line 12
Contains the argument default plugin to fetch contact ID from current user.

Class

views_plugin_argument_default_contact_id_from_user
Default argument plugin to extract contact ID from current user.

Code

function get_argument() {
  $contact = crm_core_user_sync_get_contact_from_uid($GLOBALS['user']->uid);
  if ($contact) {
    return $contact->contact_id;
  }
}