Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yeray Santana Hualde
syncEnrollments
Commits
22676cce
Commit
22676cce
authored
Aug 08, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor the query->get() method.
parent
3d30f9f8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
8 deletions
+18
-8
query.php
system/db/query.php
+18
-8
No files found.
system/db/query.php
View file @
22676cce
...
@@ -524,6 +524,22 @@ class Query {
...
@@ -524,6 +524,22 @@ class Query {
$this
->
select
(
$columns
);
$this
->
select
(
$columns
);
}
}
$results
=
$this
->
connection
->
query
(
$this
->
compile_select
(),
$this
->
bindings
);
// Reset the SELECT clause so more queries can be performed using the same instance.
// This is helpful for getting aggregates and then getting actual results.
$this
->
select
=
null
;
return
$results
;
}
/**
* Compile the query into a SQL SELECT statement.
*
* @return string
*/
private
function
compile_select
()
{
$sql
=
$this
->
select
.
' '
.
$this
->
from
.
' '
.
$this
->
where
;
$sql
=
$this
->
select
.
' '
.
$this
->
from
.
' '
.
$this
->
where
;
if
(
count
(
$this
->
orderings
)
>
0
)
if
(
count
(
$this
->
orderings
)
>
0
)
...
@@ -541,13 +557,7 @@ class Query {
...
@@ -541,13 +557,7 @@ class Query {
$sql
.=
' OFFSET '
.
$this
->
offset
;
$sql
.=
' OFFSET '
.
$this
->
offset
;
}
}
$results
=
$this
->
connection
->
query
(
$sql
,
$this
->
bindings
);
return
$sql
;
// Reset the SELECT clause so more queries can be performed using the same instance.
// This is helpful for getting aggregates and then getting actual results.
$this
->
select
=
null
;
return
$results
;
}
}
/**
/**
...
@@ -586,7 +596,7 @@ class Query {
...
@@ -586,7 +596,7 @@ class Query {
}
}
/**
/**
* Compile
an
SQL INSERT statement.
* Compile
the query into a
SQL INSERT statement.
*
*
* @param array $values
* @param array $values
* @return string
* @return string
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment