Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Extensions
Api4 Example
Commits
a5b510ac
Commit
a5b510ac
authored
Jul 16, 2020
by
colemanw
Browse files
Add screenshot & update comments
parent
19d44818
Changes
4
Hide whitespace changes
Inline
Side-by-side
Civi/Api4/Action/Example/Create.php
View file @
a5b510ac
...
...
@@ -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
;
...
...
Civi/Api4/Example.php
View file @
a5b510ac
...
...
@@ -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
()
{
...
...
README.md
View file @
a5b510ac
# 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.png
0 → 100644
View file @
a5b510ac
90.5 KB
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment