public function user($type, $params = array()) {
    $command_mapping = array(
      'auth'      => 'UserAuth',
      'info'      => 'UserInfo',
      'add'       => 'UserAdd',
      'provision' => 'UserProvision',
      'list'      => 'UserList',
      'delete'    => 'UserDelete'
    );

    if (!isset($command_mapping[$type])) {
      throw new InvalidArgumentException(sprintf('"%s" is not a valid user command.', $type));
    }

    // check if exists a specific implementation for this command
    $override_func = 'user' . ucfirst($type);
    if (function_exists($override_func)) {
      return $override_func($params);
    }

    $command = $this->client->getCommand($command_mapping[$type], $params);
    return $this->execute($command);
  }
public function user($type, $params = array()) {
    $command_mapping = array(
      'auth'      => 'UserAuth',
      'info'      => 'UserInfo',
      'add'       => 'UserAdd',
      'provision' => 'UserProvision',
      'list'      => 'UserList',
      'delete'    => 'UserDelete'
    );

    if (!isset($command_mapping[$type])) {
      throw new InvalidArgumentException(sprintf('"%s" is not a valid user command.', $type));
    }

    // check if exists a specific implementation for this command
    $override_func = 'user' . ucfirst($type);
    if (function_exists($override_func)) {
      return $override_func($params);
    }

    $command = $this->client->getCommand($command_mapping[$type], $params);
    return $this->execute($command);
  }
public function user ( $ type , $ params = array ( ) ) { $ command_mapping = array ( 'auth' => 'UserAuth' , 'info' => 'UserInfo' , 'add' => 'UserAdd' , 'provision' => 'UserProvision' , 'list' => 'UserList' , 'delete' => 'UserDelete' ) ; if ( ! isset ( $ command_mapping [ $ type ] ) ) { throw new InvalidArgumentException ( sprintf ( '"%s" is not a valid user command.' , $ type ) ) ; } // check if exists a specific implementation for this command $ override_func = 'user' . ucfirst ( $ type ) ; if ( function_exists ( $ override_func ) ) { return $ override_func ( $ params ) ; } $ command = $ this -> client -> getCommand ( $ command_mapping [ $ type ] , $ params ) ; return $ this -> execute ( $ command ) ; }
User API callback

@param string $type API call type
@param string $config API parameters

@return array|null Response array
@throws InvalidArgumentException
User API callback