File tree 2 files changed +16
-0
lines changed
2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -217,6 +217,14 @@ myObject.fetch().then((myObject) => {
217
217
});
218
218
```
219
219
220
+ If you need to check if an object has been fetched, you can call the ` isDataAvailable() ` method:
221
+
222
+ ``` javascript
223
+ if (! myObject .isDataAvailable ()) {
224
+ await myObject .fetch ();
225
+ }
226
+ ```
227
+
220
228
## Updating Objects
221
229
222
230
Updating an object is simple. Just set some new data on it and call the save method. For example:
Original file line number Diff line number Diff line change @@ -83,6 +83,14 @@ If you need to refresh an object you already have with the latest data that
83
83
$gameScore->fetch();
84
84
```
85
85
86
+ If you need to check if an object has been fetched, you can call the ` isDataAvailable() ` method:
87
+
88
+ ``` php
89
+ if (!$gameScore->isDataAvailable()) {
90
+ $gameScore->fetch();
91
+ }
92
+ ```
93
+
86
94
## Updating Objects
87
95
88
96
Updating an object is simple. Just set some new data on it and call the save method. For example:
You can’t perform that action at this time.
0 commit comments