CiviEventInspector - Document fields in an event-definition.
authorTim Otten <totten@civicrm.org>
Fri, 14 Apr 2017 03:57:02 +0000 (20:57 -0700)
committerTim Otten <totten@civicrm.org>
Fri, 14 Apr 2017 03:57:02 +0000 (20:57 -0700)
Civi/Core/CiviEventInspector.php

index 8a4f14c3bc40cadb29200228982a8d0d974f954b..4f74cc54a8d9ef24407c57bc3b2df31c29e63e8d 100644 (file)
@@ -12,6 +12,14 @@ namespace Civi\Core;
  * print_r(CRM_Utils_Array::collect('name', $i->getAll()));
  * @endCode
  *
+ * An event definition includes these fields:
+ *  - type: string, required. Ex: 'hook' or 'object'
+ *  - name: string, required. Ex: 'hook_civicrm_post' or 'civi.dao.postInsert'
+ *  - class: string, required. Ex: 'Civi\Core\Event\GenericHookEvent'.
+ *  - signature: string, required FOR HOOKS. Ex: '$first, &$second'.
+ *  - fields: array, required FOR HOOKS. List of hook parameters.
+ *  - stub: ReflectionMethod, optional. An example function with docblocks/inputs.
+ *
  * Note: The inspector is only designed for use in developer workflows, such
  * as code-generation and inspection. It should be not called by regular
  * runtime logic.