Skip to content

Instantly share code, notes, and snippets.

@soutar
Last active August 29, 2015 14:22
Show Gist options
  • Save soutar/abc9f1a80da7e0932ec6 to your computer and use it in GitHub Desktop.
Save soutar/abc9f1a80da7e0932ec6 to your computer and use it in GitHub Desktop.
PHP vs JS stv apis
api
.get('episodes')
.orderBy(['matId'])
.where({'shortName': 'The Riverside Show'})
.go()
.then((episodes) => {
// episodes is an array of Episode instances, not just plain objects
});
// or even
api
.get('episodes')
.orderBy(['matId'])
.where({'shortName': 'The Riverside Show'})
.then((episodes) => {
// do something
});
$episodes = $api
->get('episodes')
->orderBy(['matId'])
->where(['shortName' => 'The Riverside Show'])
->go();
// episodes is an array of Episode instances, not just plain objects/arrays
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment