Last active
August 29, 2015 14:22
-
-
Save soutar/abc9f1a80da7e0932ec6 to your computer and use it in GitHub Desktop.
PHP vs JS stv apis
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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