-
Notifications
You must be signed in to change notification settings - Fork 1.5k
DOCSP-43159: QB returns objects #3135
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
Changes from 4 commits
b4550fc
32576f2
aa47740
e1927ee
faffb66
fd00783
747f813
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -14,7 +14,7 @@ Upgrade Library Version | |||||||||||||||||||||
.. contents:: On this page | ||||||||||||||||||||||
:local: | ||||||||||||||||||||||
:backlinks: none | ||||||||||||||||||||||
:depth: 1 | ||||||||||||||||||||||
:depth: 2 | ||||||||||||||||||||||
:class: singlecol | ||||||||||||||||||||||
|
||||||||||||||||||||||
Overview | ||||||||||||||||||||||
|
@@ -71,6 +71,21 @@ Version 5.x Breaking Changes | |||||||||||||||||||||
|
||||||||||||||||||||||
This library version introduces the following breaking changes: | ||||||||||||||||||||||
|
||||||||||||||||||||||
- The query builder returns results as objects, instead of as arrays. | ||||||||||||||||||||||
This change requires that you change array access to property access | ||||||||||||||||||||||
when interacting with query results. | ||||||||||||||||||||||
|
||||||||||||||||||||||
The following code shows how to retrieve a query result and access a | ||||||||||||||||||||||
property from the result object: | ||||||||||||||||||||||
|
||||||||||||||||||||||
.. code-block:: php | ||||||||||||||||||||||
:emphasize-lines: 4 | ||||||||||||||||||||||
|
||||||||||||||||||||||
DB::table('accounts') | ||||||||||||||||||||||
->where('name', 'Anita Charles') | ||||||||||||||||||||||
->first() | ||||||||||||||||||||||
->balance | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could highlight the change with a diff (not sure if diffs are correctly colorized in the docs):
Suggested change
Preview: $document = DB::table('accounts')
->where('name', 'Anita Charles')
->first();
- $document['balance'];
+ $document->balance; There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The only way we can demonstrate this is by using code comments. I can make that change though! |
||||||||||||||||||||||
|
||||||||||||||||||||||
- In query results, the library converts BSON ``UTCDateTime`` objects to ``Carbon`` | ||||||||||||||||||||||
date classes, applying the default timezone. | ||||||||||||||||||||||
|
||||||||||||||||||||||
|
Uh oh!
There was an error while loading. Please reload this page.