Commit a5b510ac authored by colemanw's avatar colemanw
Browse files

Add screenshot & update comments

parent 19d44818
......@@ -26,9 +26,11 @@ namespace Civi\Api4\Action\Example;
class Create extends \Civi\Api4\Generic\BasicCreateAction {
/**
* We can override the default value of params, or add docblocks to them, by redeclaring them in our action override.
* We can override the default value of params, or add docblocks to them,
* by redeclaring them in our action override.
*
* If we want the original docblock to appear in the _API Explorer_ as well, we do this:
* For the parent's docblock contents to appear in the _API Explorer_ as well,
* we add the `@inheritDoc` annotation and get this:
* @inheritDoc
*/
protected $debug = TRUE;
......
......@@ -180,8 +180,8 @@ class Example extends Generic\AbstractEntity {
* This is because it calls `Get`, `Save` and `Delete` internally - those must be defined for an entity to implement `Replace`.
*
* Read more about the `Replace` action:
* @inheritDoc
* @see \Civi\Api4\Generic\BasicReplaceAction
*
* @return \Civi\Api4\Generic\BasicReplaceAction
*/
public static function replace() {
......
# CiviCRM Api4 Example
#### Code examples to supplement the [APIv4 Architecture](https://docs.civicrm.org/dev/en/latest/api/v4/architecture/) documentation.
This extension declares an APIv4 entity named `Example`. It is a simple but fully-functional api which reads & writes test data from a json file.
The thoroughly commented code demonstrates how to create your own api for any arbitrary data source,
......@@ -14,7 +16,7 @@ To get started:
- Select the `Example` entity.
- Read the help text and try out the various actions (they really work!).
These examples supplement the [APIv4 Architecture](https://docs.civicrm.org/dev/en/latest/api/v4/architecture/) documentation.
![Screenshot](Screenshot.png)
-----
......
Supports Markdown
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