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
77cdde2a
Commit
77cdde2a
authored
Apr 29, 2014
by
jeroendedauw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix CQS issue in _createIndex
parent
41a2709c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
Table.php
lib/Doctrine/DBAL/Schema/Table.php
+6
-8
No files found.
lib/Doctrine/DBAL/Schema/Table.php
View file @
77cdde2a
...
@@ -132,14 +132,14 @@ class Table extends AbstractAsset
...
@@ -132,14 +132,14 @@ class Table extends AbstractAsset
*/
*/
public
function
setPrimaryKey
(
array
$columns
,
$indexName
=
false
)
public
function
setPrimaryKey
(
array
$columns
,
$indexName
=
false
)
{
{
$
primaryKey
=
$this
->
_createIndex
(
$columns
,
$indexName
?:
"primary"
,
true
,
true
);
$
this
->
_addIndex
(
$this
->
_createIndex
(
$columns
,
$indexName
?:
"primary"
,
true
,
true
)
);
foreach
(
$columns
as
$columnName
)
{
foreach
(
$columns
as
$columnName
)
{
$column
=
$this
->
getColumn
(
$columnName
);
$column
=
$this
->
getColumn
(
$columnName
);
$column
->
setNotnull
(
true
);
$column
->
setNotnull
(
true
);
}
}
return
$
primaryKey
;
return
$
this
;
}
}
/**
/**
...
@@ -157,7 +157,7 @@ class Table extends AbstractAsset
...
@@ -157,7 +157,7 @@ class Table extends AbstractAsset
);
);
}
}
return
$this
->
_
createIndex
(
$columnNames
,
$indexName
,
false
,
false
,
$flags
);
return
$this
->
_
addIndex
(
$this
->
_createIndex
(
$columnNames
,
$indexName
,
false
,
false
,
$flags
)
);
}
}
/**
/**
...
@@ -203,7 +203,7 @@ class Table extends AbstractAsset
...
@@ -203,7 +203,7 @@ class Table extends AbstractAsset
);
);
}
}
return
$this
->
_
createIndex
(
$columnNames
,
$indexName
,
true
,
false
);
return
$this
->
_
addIndex
(
$this
->
_createIndex
(
$columnNames
,
$indexName
,
true
,
false
)
);
}
}
/**
/**
...
@@ -278,7 +278,7 @@ class Table extends AbstractAsset
...
@@ -278,7 +278,7 @@ class Table extends AbstractAsset
* @param boolean $isPrimary
* @param boolean $isPrimary
* @param array $flags
* @param array $flags
*
*
* @return
self
* @return
Index
*
*
* @throws SchemaException
* @throws SchemaException
*/
*/
...
@@ -298,9 +298,7 @@ class Table extends AbstractAsset
...
@@ -298,9 +298,7 @@ class Table extends AbstractAsset
}
}
}
}
$this
->
_addIndex
(
new
Index
(
$indexName
,
$columnNames
,
$isUnique
,
$isPrimary
,
$flags
));
return
new
Index
(
$indexName
,
$columnNames
,
$isUnique
,
$isPrimary
,
$flags
);
return
$this
;
}
}
/**
/**
...
...
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