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
277be848
Commit
277be848
authored
Aug 02, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added where_id and or_where_id to the query builder.
parent
320c72ed
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
1 deletion
+26
-1
query.php
system/db/query.php
+26
-1
No files found.
system/db/query.php
View file @
277be848
...
...
@@ -2,6 +2,7 @@
use
System\Str
;
use
System\Config
;
use
System\Paginator
;
class
Query
{
...
...
@@ -238,6 +239,30 @@ class Query {
return
$this
->
where
(
$column
,
$operator
,
$value
,
'OR'
);
}
/**
* Add a where condition for the primary key to the query.
* This is simply a short-cut method for convenience.
*
* @param mixed $value
* @return Query
*/
public
function
where_id
(
$value
)
{
return
$this
->
where
(
'id'
,
'='
,
$value
);
}
/**
* Add an or where condition for the primary key to the query.
* This is simply a short-cut method for convenience.
*
* @param mixed $value
* @return Query
*/
public
function
or_where_id
(
$value
)
{
return
$this
->
or_where
(
'id'
,
'='
,
$value
);
}
/**
* Add a where in condition to the query.
*
...
...
@@ -473,7 +498,7 @@ class Query {
$this
->
select
(
$columns
);
return
\System\Paginator
::
make
(
$this
->
for_page
(
\System\
Paginator
::
page
(
$total
,
$per_page
),
$per_page
)
->
get
(),
$total
,
$per_page
);
return
Paginator
::
make
(
$this
->
for_page
(
Paginator
::
page
(
$total
,
$per_page
),
$per_page
)
->
get
(),
$total
,
$per_page
);
}
/**
...
...
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