Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Tomáš Trávníček
doctrine-dbal
Commits
478d4f0f
Unverified
Commit
478d4f0f
authored
Jul 17, 2020
by
Sergei Morozov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename $tableExpression and $tableName in Connection methods to $table
parent
8537f522
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
23 deletions
+23
-23
Connection.php
lib/Doctrine/DBAL/Connection.php
+17
-17
MasterSlaveConnection.php
lib/Doctrine/DBAL/Connections/MasterSlaveConnection.php
+6
-6
No files found.
lib/Doctrine/DBAL/Connection.php
View file @
478d4f0f
...
...
@@ -643,7 +643,7 @@ class Connection implements DriverConnection
*
* Table expression and columns are not escaped and are not safe for user-input.
*
* @param string $table
Expression
The expression of the table on which to delete.
* @param string $table
The expression of the table on which to delete.
* @param mixed[] $identifier The deletion criteria. An associative array containing column-value pairs.
* @param int[]|string[] $types The types of identifiers.
*
...
...
@@ -652,7 +652,7 @@ class Connection implements DriverConnection
* @throws DBALException
* @throws InvalidArgumentException
*/
public
function
delete
(
$table
Expression
,
array
$identifier
,
array
$types
=
[])
public
function
delete
(
$table
,
array
$identifier
,
array
$types
=
[])
{
if
(
empty
(
$identifier
))
{
throw
InvalidArgumentException
::
fromEmptyCriteria
();
...
...
@@ -663,7 +663,7 @@ class Connection implements DriverConnection
$this
->
addIdentifierCondition
(
$identifier
,
$columns
,
$values
,
$conditions
);
return
$this
->
executeUpdate
(
'DELETE FROM '
.
$table
Expression
.
' WHERE '
.
implode
(
' AND '
,
$conditions
),
'DELETE FROM '
.
$table
.
' WHERE '
.
implode
(
' AND '
,
$conditions
),
$values
,
is_string
(
key
(
$types
))
?
$this
->
extractTypeValues
(
$columns
,
$types
)
:
$types
);
...
...
@@ -714,7 +714,7 @@ class Connection implements DriverConnection
*
* Table expression and columns are not escaped and are not safe for user-input.
*
* @param string $table
Expression
The expression of the table to update quoted or unquoted.
* @param string $table
The expression of the table to update quoted or unquoted.
* @param mixed[] $data An associative array containing column-value pairs.
* @param mixed[] $identifier The update criteria. An associative array containing column-value pairs.
* @param int[]|string[] $types Types of the merged $data and $identifier arrays in that order.
...
...
@@ -723,7 +723,7 @@ class Connection implements DriverConnection
*
* @throws DBALException
*/
public
function
update
(
$table
Expression
,
array
$data
,
array
$identifier
,
array
$types
=
[])
public
function
update
(
$table
,
array
$data
,
array
$identifier
,
array
$types
=
[])
{
$columns
=
$values
=
$conditions
=
$set
=
[];
...
...
@@ -739,7 +739,7 @@ class Connection implements DriverConnection
$types
=
$this
->
extractTypeValues
(
$columns
,
$types
);
}
$sql
=
'UPDATE '
.
$table
Expression
.
' SET '
.
implode
(
', '
,
$set
)
$sql
=
'UPDATE '
.
$table
.
' SET '
.
implode
(
', '
,
$set
)
.
' WHERE '
.
implode
(
' AND '
,
$conditions
);
return
$this
->
executeUpdate
(
$sql
,
$values
,
$types
);
...
...
@@ -750,7 +750,7 @@ class Connection implements DriverConnection
*
* Table expression and columns are not escaped and are not safe for user-input.
*
* @param string $table
Expression
The expression of the table to insert data into, quoted or unquoted.
* @param string $table The expression of the table to insert data into, quoted or unquoted.
* @param mixed[] $data An associative array containing column-value pairs.
* @param int[]|string[] $types Types of the inserted data.
*
...
...
@@ -758,10 +758,10 @@ class Connection implements DriverConnection
*
* @throws DBALException
*/
public
function
insert
(
$table
Expression
,
array
$data
,
array
$types
=
[])
public
function
insert
(
$table
,
array
$data
,
array
$types
=
[])
{
if
(
empty
(
$data
))
{
return
$this
->
executeUpdate
(
'INSERT INTO '
.
$table
Expression
.
' () VALUES ()'
);
return
$this
->
executeUpdate
(
'INSERT INTO '
.
$table
.
' () VALUES ()'
);
}
$columns
=
[];
...
...
@@ -775,7 +775,7 @@ class Connection implements DriverConnection
}
return
$this
->
executeUpdate
(
'INSERT INTO '
.
$table
Expression
.
' ('
.
implode
(
', '
,
$columns
)
.
')'
.
'INSERT INTO '
.
$table
.
' ('
.
implode
(
', '
,
$columns
)
.
')'
.
' VALUES ('
.
implode
(
', '
,
$set
)
.
')'
,
$values
,
is_string
(
key
(
$types
))
?
$this
->
extractTypeValues
(
$columns
,
$types
)
:
$types
...
...
lib/Doctrine/DBAL/Connections/MasterSlaveConnection.php
View file @
478d4f0f
...
...
@@ -263,11 +263,11 @@ class MasterSlaveConnection extends Connection
/**
* {@inheritDoc}
*/
public
function
delete
(
$table
Name
,
array
$identifier
,
array
$types
=
[])
public
function
delete
(
$table
,
array
$identifier
,
array
$types
=
[])
{
$this
->
connect
(
'master'
);
return
parent
::
delete
(
$table
Name
,
$identifier
,
$types
);
return
parent
::
delete
(
$table
,
$identifier
,
$types
);
}
/**
...
...
@@ -286,21 +286,21 @@ class MasterSlaveConnection extends Connection
/**
* {@inheritDoc}
*/
public
function
update
(
$table
Name
,
array
$data
,
array
$identifier
,
array
$types
=
[])
public
function
update
(
$table
,
array
$data
,
array
$identifier
,
array
$types
=
[])
{
$this
->
connect
(
'master'
);
return
parent
::
update
(
$table
Name
,
$data
,
$identifier
,
$types
);
return
parent
::
update
(
$table
,
$data
,
$identifier
,
$types
);
}
/**
* {@inheritDoc}
*/
public
function
insert
(
$table
Name
,
array
$data
,
array
$types
=
[])
public
function
insert
(
$table
,
array
$data
,
array
$types
=
[])
{
$this
->
connect
(
'master'
);
return
parent
::
insert
(
$table
Name
,
$data
,
$types
);
return
parent
::
insert
(
$table
,
$data
,
$types
);
}
/**
...
...
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