Skip to content

Commit 0e61d46

Browse files
committed
Update docs
1 parent 4319495 commit 0e61d46

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

docs/utils-factory.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,17 @@ Assuming you want a `toJson()` functionality in your document object. First crea
1919

2020
```php
2121
namespace My\Own
22-
class Document extends \Art4\JsonApiClient\Document
22+
class Document implements \Art4\JsonApiClient\DocumentInterface
2323
{
24+
// Implement the \Art4\JsonApiClient\DocumentInterface here
25+
/*
26+
public function get($key);
27+
public function has($key);
28+
public function getKeys();
29+
public function asArray();
30+
*/
31+
32+
// your new method
2433
public function toJson()
2534
{
2635
return json_encode($this->asArray(true));

src/Utils/AccessTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
trait AccessTrait
99
{
1010
/**
11-
* Check if a value exists in this document
11+
* Check if a value exists in this object
1212
*
1313
* @param string $key The key of the value
1414
* @return bool true if data exists, false if not
@@ -19,7 +19,7 @@ public function has($key)
1919
}
2020

2121
/**
22-
* Returns the keys of all setted values in this document
22+
* Returns the keys of all setted values in this object
2323
*
2424
* @return array Keys of all setted values
2525
*/

0 commit comments

Comments
 (0)