Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation for isDataAvailable #647

Merged
merged 2 commits into from
Jul 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions _includes/js/objects.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,14 @@ myObject.fetch().then((myObject) => {
});
```

If you need to check if an object has been fetched, you can call the `isDataAvailable()` method:

```javascript
if (!myObject.isDataAvailable()) {
await myObject.fetch();
}
```

## Updating Objects

Updating an object is simple. Just set some new data on it and call the save method. For example:
Expand Down
8 changes: 8 additions & 0 deletions _includes/php/objects.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ If you need to refresh an object you already have with the latest data that
$gameScore->fetch();
```

If you need to check if an object has been fetched, you can call the `isDataAvailable()` method:

```php
if (!$gameScore->isDataAvailable()) {
$gameScore->fetch();
}
```

## Updating Objects

Updating an object is simple. Just set some new data on it and call the save method. For example:
Expand Down