public function getSynchMappings($direction = LDAP_USER_PROV_DIRECTION_ALL, $prov_events = NULL) {
    if (!$prov_events) {
      $prov_events = ldap_user_all_events();
    }

    $mappings = array();
    if ($direction == LDAP_USER_PROV_DIRECTION_ALL) {
      $directions = array(LDAP_USER_PROV_DIRECTION_TO_DRUPAL_USER, LDAP_USER_PROV_DIRECTION_TO_LDAP_ENTRY);
    }
    else {
      $directions = array($direction);
    }
    foreach ($directions as $direction) {
      if (!empty($this->ldapUserSynchMappings[$direction])) {
        foreach ($this->ldapUserSynchMappings[$direction] as $attribute => $mapping) {
          if (!empty($mapping['prov_events'])) {
            $result = count(array_intersect($prov_events, $mapping['prov_events']));
            if ($result) {
              $mappings[$attribute] = $mapping;
            }
          }
        }
      }
    }
    return $mappings;
  }
public function getSynchMappings($direction = LDAP_USER_PROV_DIRECTION_ALL, $prov_events = NULL) {
    if (!$prov_events) {
      $prov_events = ldap_user_all_events();
    }

    $mappings = array();
    if ($direction == LDAP_USER_PROV_DIRECTION_ALL) {
      $directions = array(LDAP_USER_PROV_DIRECTION_TO_DRUPAL_USER, LDAP_USER_PROV_DIRECTION_TO_LDAP_ENTRY);
    }
    else {
      $directions = array($direction);
    }
    foreach ($directions as $direction) {
      if (!empty($this->ldapUserSynchMappings[$direction])) {
        foreach ($this->ldapUserSynchMappings[$direction] as $attribute => $mapping) {
          if (!empty($mapping['prov_events'])) {
            $result = count(array_intersect($prov_events, $mapping['prov_events']));
            if ($result) {
              $mappings[$attribute] = $mapping;
            }
          }
        }
      }
    }
    return $mappings;
  }
public function getSynchMappings ( $ direction = LDAP_USER_PROV_DIRECTION_ALL , $ prov_events = NULL ) { if ( ! $ prov_events ) { $ prov_events = ldap_user_all_events ( ) ; } $ mappings = array ( ) ; if ( $ direction == LDAP_USER_PROV_DIRECTION_ALL ) { $ directions = array ( LDAP_USER_PROV_DIRECTION_TO_DRUPAL_USER , LDAP_USER_PROV_DIRECTION_TO_LDAP_ENTRY ) ; } else { $ directions = array ( $ direction ) ; } foreach ( $ directions as $ direction ) { if ( ! empty ( $ this -> ldapUserSynchMappings [ $ direction ] ) ) { foreach ( $ this -> ldapUserSynchMappings [ $ direction ] as $ attribute => $ mapping ) { if ( ! empty ( $ mapping [ 'prov_events' ] ) ) { $ result = count ( array_intersect ( $ prov_events , $ mapping [ 'prov_events' ] ) ) ; if ( $ result ) { $ mappings [ $ attribute ] = $ mapping ; } } } } } return $ mappings ; }
Util to fetch mappings for a given direction

@param string $sid
The server id
@param string $direction LDAP_USER_PROV_DIRECTION_* constant
@param array $prov_events

@return array/bool
Array of mappings (may be empty array)
Util to fetch mappings for a given direction