Skip to content

Commit 5234af8

Browse files
committed
Basic Event documentation
1 parent bc70fee commit 5234af8

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

docs/EVENT.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,26 @@ object.
1919
Below is a quick example:
2020

2121
```php
22-
$event = new
22+
$userEvent = new \DCarbone\PHPConsulAPI\Event\UserEvent(
23+
array(
24+
'Name' => 'sandwiches',
25+
'Payload' => 'They are tasty.'
26+
)
27+
);
28+
29+
list($event, $wm, $err) = $client->Event()->fire($userEvent);
30+
if (null !== $err)
31+
die($err);
32+
33+
var_dump($event, $wm);
34+
```
35+
36+
### List Events
37+
38+
```php
39+
list($userEvents, $qm, $err) = $client->Event()->eventList();
40+
if (null !== $err)
41+
die($err);
42+
43+
var_dump($userEvents, $qm);
2344
```

0 commit comments

Comments
 (0)