Commit 60c1ab0c authored by Klaas Eikelboom's avatar Klaas Eikelboom
Browse files

Documented adding dataprocessors to your extension

parent 91b38077
# Version 1.42 (not yet released)
* Documented adding dataprocessors to your extension.
* Ability to return multi-valued field as an array.
# Version 1.41
......
......@@ -34,7 +34,7 @@ The extension is licensed under [AGPL-3.0](LICENSE.txt).
* [Available Hooks](docs/hooks.md)
* [Add your own data source for a CiviCRM Entity](docs/add_your_own_datasource.md)
* Add your own data source for a CSV File
* How to store a data processor in code in your extension
* * [Add your own data source for a CiviCRM Entity](docs/add_your_own_datasource.md)
* [Data Flow Classes](docs/dev/DataFlowClasses.md) - Overview of all the available data flow classes.
* [Develop PHPUnit TestCase for the extension](docs/how_to_create_test.md)
......
# Add a dataprocessor to your extension
Adding dataprocessors to an extension allows you to put them in version control and move them in a structured way from development to production. And dataprocessors can provide custom reports, custom tokens and custom action lists.
Dataprocessors creates a dependence on the `dataprocessor` extension. Its good practice to add this to the `info.xml` file.
````xml
<requires>
<ext>dataprocessor</ext>
</requires>
````
Create in your extension a subdirectory with the name `data-processors`. Export your dataprocessors and copy them to
this directory. Now they can be imported with the following code.
````php
CRM_Dataprocessor_Utils_Importer::importFromExtensions('<your extension>');
````
If you want the dataprocessors installed directly after the installation of the extension, use the `postInstall` method of the Upgrader class.
````php
public function postInstall() {
CRM_Dataprocessor_Utils_Importer::importFromExtensions(E::LONG_NAME);
}
````
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment