-
Notifications
You must be signed in to change notification settings - Fork 440
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update datastore README example. (#221)
* Update datastore README example. * Resolve code review
- Loading branch information
Showing
1 changed file
with
7 additions
and
7 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -169,13 +169,13 @@ $bob['firstName'] = 'Bob'; | |
$bob['email'] = '[email protected]'; | ||
$datastore->insert($bob); | ||
|
||
// Fetch an entity | ||
$key = $datastore->key('Person', 'Bob'); | ||
$bob = $datastore->lookup($key); | ||
|
||
// Update an entity | ||
$bob['email'] = '[email protected]'; | ||
// Update the entity | ||
$bob['email'] = '[email protected]'; | ||
$datastore->update($bob); | ||
|
||
// If you know the ID of the entity, you can look it up | ||
$key = $datastore->key('Person', '12345328897844'); | ||
$entity = $datastore->lookup($key); | ||
``` | ||
|
||
## Google Cloud Natural Language | ||
|
@@ -356,7 +356,7 @@ require 'vendor/autoload.php'; | |
use Google\Cloud\Storage\StorageClient; | ||
use Symfony\Component\Cache\Adapter\ArrayAdapter; | ||
|
||
// Please take the proper precautions when storing your access tokens in a cache no matter the implementation. | ||
// Please take the proper precautions when storing your access tokens in a cache no matter the implementation. | ||
$cache = new ArrayAdapter(); | ||
|
||
$storage = new StorageClient([ | ||
|