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
17e0a24d
Commit
17e0a24d
authored
Aug 05, 2014
by
Adrien Crivelli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix more code style as mentionned in PR comments
parent
83bb8478
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
16 deletions
+30
-16
UPGRADE.md
UPGRADE.md
+6
-0
AbstractPlatform.php
lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
+5
-5
Index.php
lib/Doctrine/DBAL/Schema/Index.php
+19
-11
No files found.
UPGRADE.md
View file @
17e0a24d
# Upgrade to 2.5
## BC BREAK: Doctrine\DBAL\Schema\Table
The method
``addIndex()``
in
``Doctrine\DBAL\Schema\Table``
has an additional,
optional parameter. If you override this method, you should add this new parameter
to the declaration of your overridden method.
## BC BREAK: Doctrine\DBAL\Connection
The visibility of the property
``$_platform``
in
``Doctrine\DBAL\Connection``
...
...
lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
View file @
17e0a24d
...
...
@@ -1761,9 +1761,9 @@ abstract class AbstractPlatform
{
if
(
$this
->
supportsPartialIndexes
()
&&
$index
->
hasOption
(
'where'
))
{
return
' WHERE '
.
$index
->
getOption
(
'where'
);
}
else
{
return
''
;
}
return
''
;
}
/**
...
...
@@ -2341,8 +2341,8 @@ abstract class AbstractPlatform
}
return
$this
->
getCreateIndexSQLFlags
(
$index
)
.
'INDEX '
.
$name
.
' ('
.
$this
->
getIndexFieldDeclarationListSQL
(
$columns
)
.
')'
.
$this
->
getPartialIndexSQL
(
$index
);
.
$this
->
getIndexFieldDeclarationListSQL
(
$columns
)
.
')'
.
$this
->
getPartialIndexSQL
(
$index
);
}
/**
...
...
@@ -2600,7 +2600,7 @@ abstract class AbstractPlatform
return
$item
;
}
/**
* Some platforms have boolean literals that needs to be correctly converted
*
...
...
lib/Doctrine/DBAL/Schema/Index.php
View file @
17e0a24d
...
...
@@ -52,11 +52,11 @@ class Index extends AbstractAsset implements Constraint
/**
* Platform specific options
*
* $_flags should eventually be refactored into options
*
@todo
$_flags should eventually be refactored into options
*
* @var array
*/
pr
otected
$options
=
array
();
pr
ivate
$options
=
array
();
/**
* @param string $indexName
...
...
@@ -210,17 +210,23 @@ class Index extends AbstractAsset implements Constraint
$sameColumns
=
$this
->
spansColumns
(
$other
->
getColumns
());
if
(
$sameColumns
)
{
if
(
!
$this
->
samePartialIndex
(
$other
))
{
if
(
!
$this
->
samePartialIndex
(
$other
))
{
return
false
;
}
elseif
(
!
$this
->
isUnique
()
&&
!
$this
->
isPrimary
())
{
}
if
(
!
$this
->
isUnique
()
&&
!
$this
->
isPrimary
())
{
// this is a special case: If the current key is neither primary or unique, any uniqe or
// primary key will always have the same effect for the index and there cannot be any constraint
// overlaps. This means a primary or unique index can always fulfill the requirements of just an
// index that has no constraints.
return
true
;
}
elseif
(
$other
->
isPrimary
()
!=
$this
->
isPrimary
())
{
}
if
(
$other
->
isPrimary
()
!=
$this
->
isPrimary
())
{
return
false
;
}
elseif
(
$other
->
isUnique
()
!=
$this
->
isUnique
())
{
}
if
(
$other
->
isUnique
()
!=
$this
->
isUnique
())
{
return
false
;
}
...
...
@@ -309,7 +315,7 @@ class Index extends AbstractAsset implements Constraint
*/
public
function
hasOption
(
$name
)
{
return
isset
(
$this
->
options
[
$name
]);
return
isset
(
$this
->
options
[
strtolower
(
$name
)
]);
}
/**
...
...
@@ -319,7 +325,7 @@ class Index extends AbstractAsset implements Constraint
*/
public
function
getOption
(
$name
)
{
return
$this
->
options
[
$name
];
return
$this
->
options
[
strtolower
(
$name
)
];
}
/**
...
...
@@ -339,11 +345,13 @@ class Index extends AbstractAsset implements Constraint
{
if
(
$this
->
hasOption
(
'where'
)
&&
$other
->
hasOption
(
'where'
)
&&
$this
->
getOption
(
'where'
)
==
$other
->
getOption
(
'where'
))
{
return
true
;
}
elseif
(
!
$this
->
hasOption
(
'where'
)
&&
!
$other
->
hasOption
(
'where'
))
{
}
if
(
!
$this
->
hasOption
(
'where'
)
&&
!
$other
->
hasOption
(
'where'
))
{
return
true
;
}
else
{
return
false
;
}
return
false
;
}
}
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