Skip to content

Commit

Permalink
Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
rotexdegba committed May 6, 2018
1 parent 604693e commit 3b7b9b9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions docs/QUICKSTART.md
Original file line number Diff line number Diff line change
Expand Up @@ -645,10 +645,9 @@ To check if a key exists in the collection, you can call `isset` like so:
// will throw an exception because there is no `hobby` key in each item's array
// $empty_generic_collection->setValForEachItem('hobby', 'Baseball');


// Now, add a hobby field to each collection item with a value of `Baseball`.
// Will not throw an exception even though there is no `hobby` key in each item's array
// because we paased a third parameter value of true, allowing setValForEachItem to
// because we passed a third parameter value of true, allowing setValForEachItem to
// add non-existent keys to each item.
$empty_generic_collection->setValForEachItem('hobby', 'Baseball', true);

Expand Down Expand Up @@ -700,7 +699,7 @@ To check if a key exists in the collection, you can call `isset` like so:
`setValForEachItem` also works with a collection containing objects:

```php
$collection = new \GenericCollection();
$collection = new \VersatileCollections\GenericCollection();
$collection[] = (object)['name'=>'Joe', 'age'=>'10',];
$collection[] = (object)['name'=>'Jane', 'age'=>'20',];
$collection[] = (object)['name'=>'Janice', 'age'=>'30',];
Expand All @@ -713,7 +712,7 @@ To check if a key exists in the collection, you can call `isset` like so:

// Now, add a hobby property to each collection item with a value of `Baseball`.
// Will not throw an exception even though there is no `hobby` property in each item's
// object because we paased a third parameter value of true, allowing setValForEachItem to
// object because we passed a third parameter value of true, allowing setValForEachItem to
// add non-existent property to each item.
$collection->setValForEachItem('hobby', 'Baseball', true);

Expand Down

0 comments on commit 3b7b9b9

Please sign in to comment.