Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
UserAdminV2
Overview
Overview
Details
Activity
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
庄欣
UserAdminV2
Commits
ebf89b72
Commit
ebf89b72
authored
Jun 16, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve db class comments.
parent
825ac35a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
system/db.php
+10
-9
No files found.
system/db.php
View file @
ebf89b72
...
...
@@ -3,7 +3,7 @@
class
DB
{
/**
* The
active
database connections.
* The
established
database connections.
*
* @var array
*/
...
...
@@ -25,6 +25,8 @@ class DB {
// ---------------------------------------------------
// If we have already established this connection,
// simply return the existing connection.
//
// Don't want to establish the same connection twice!
// ---------------------------------------------------
if
(
!
array_key_exists
(
$connection
,
static
::
$connections
))
{
...
...
@@ -35,9 +37,6 @@ class DB {
throw
new
\Exception
(
"Database connection [
$connection
] is not defined."
);
}
// ---------------------------------------------------
// Establish the database connection.
// ---------------------------------------------------
static
::
$connections
[
$connection
]
=
DB\Connector
::
connect
((
object
)
$config
[
$connection
]);
}
...
...
@@ -59,13 +58,13 @@ class DB {
$result
=
$query
->
execute
(
$bindings
);
// ---------------------------------------------------
// For SELECT statements,
return the results in an
// array of stdClasses.
// For SELECT statements,
the results will be returned
// a
s an a
rray of stdClasses.
//
// For UPDATE and DELETE statements,
return the number
//
or rows affected by the query
.
// For UPDATE and DELETE statements,
the number of
//
rows affected by the query will be returned
.
//
// For
everything else
, return a boolean.
// For
all other statements
, return a boolean.
// ---------------------------------------------------
if
(
strpos
(
Str
::
upper
(
$sql
),
'SELECT'
)
===
0
)
{
...
...
@@ -84,6 +83,8 @@ class DB {
/**
* Begin a fluent query against a table.
*
* This method is simply a convenient shortcut into Query::table.
*
* @param string $table
* @param string $connection
* @return Query
...
...
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