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
4b1ad761
Commit
4b1ad761
authored
May 01, 2013
by
Benjamin Eberlei
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #308 from bamarni/index-flags
added index flags to schema table
parents
d0e60928
7f9e9927
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
Table.php
lib/Doctrine/DBAL/Schema/Table.php
+6
-4
No files found.
lib/Doctrine/DBAL/Schema/Table.php
View file @
4b1ad761
...
@@ -146,9 +146,10 @@ class Table extends AbstractAsset
...
@@ -146,9 +146,10 @@ class Table extends AbstractAsset
/**
/**
* @param array $columnNames
* @param array $columnNames
* @param string $indexName
* @param string $indexName
* @param array $flags
* @return Table
* @return Table
*/
*/
public
function
addIndex
(
array
$columnNames
,
$indexName
=
null
)
public
function
addIndex
(
array
$columnNames
,
$indexName
=
null
,
array
$flags
=
array
()
)
{
{
if
(
$indexName
==
null
)
{
if
(
$indexName
==
null
)
{
$indexName
=
$this
->
_generateIdentifierName
(
$indexName
=
$this
->
_generateIdentifierName
(
...
@@ -156,7 +157,7 @@ class Table extends AbstractAsset
...
@@ -156,7 +157,7 @@ class Table extends AbstractAsset
);
);
}
}
return
$this
->
_createIndex
(
$columnNames
,
$indexName
,
false
,
false
);
return
$this
->
_createIndex
(
$columnNames
,
$indexName
,
false
,
false
,
$flags
);
}
}
/**
/**
...
@@ -226,9 +227,10 @@ class Table extends AbstractAsset
...
@@ -226,9 +227,10 @@ class Table extends AbstractAsset
* @param string $indexName
* @param string $indexName
* @param bool $isUnique
* @param bool $isUnique
* @param bool $isPrimary
* @param bool $isPrimary
* @param array $flags
* @return Table
* @return Table
*/
*/
private
function
_createIndex
(
array
$columnNames
,
$indexName
,
$isUnique
,
$isPrimary
)
private
function
_createIndex
(
array
$columnNames
,
$indexName
,
$isUnique
,
$isPrimary
,
array
$flags
=
array
()
)
{
{
if
(
preg_match
(
'(([^a-zA-Z0-9_]+))'
,
$indexName
))
{
if
(
preg_match
(
'(([^a-zA-Z0-9_]+))'
,
$indexName
))
{
throw
SchemaException
::
indexNameInvalid
(
$indexName
);
throw
SchemaException
::
indexNameInvalid
(
$indexName
);
...
@@ -243,7 +245,7 @@ class Table extends AbstractAsset
...
@@ -243,7 +245,7 @@ class Table extends AbstractAsset
throw
SchemaException
::
columnDoesNotExist
(
$columnName
,
$this
->
_name
);
throw
SchemaException
::
columnDoesNotExist
(
$columnName
,
$this
->
_name
);
}
}
}
}
$this
->
_addIndex
(
new
Index
(
$indexName
,
$columnNames
,
$isUnique
,
$isPrimary
));
$this
->
_addIndex
(
new
Index
(
$indexName
,
$columnNames
,
$isUnique
,
$isPrimary
,
$flags
));
return
$this
;
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