I just wrote an extension with short-name "genderselfidentify" (it's cool, you should check it out), which implements hook_civicrm_apiWrappers. This hook requires you to declare a class for your api wrapper functions, but the docs for it don't say exactly what you should name the class or where you should put it. The example given is:
function example_civicrm_apiWrappers(&$wrappers, $apiRequest) {
$wrappers[] = new api_v3_APIWrapperExample();
}
Which implies that
- The class name should start with
api_v3_
- It should be placed in the extension's
api/v3
directory - (noting the lack of
require_once
in the example) it will be autoloaded by CiviCRM.
I found all the above to be true, naming my class api_v3_GenderselfidentifyAPIWrapper
the autoloading and wrapper functionality worked great... but then I noticed something strange in the API Explorer:
Why is my wrapper class showing up as if it were an entity?