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
0b3a3c38
Commit
0b3a3c38
authored
Feb 11, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Index support added!
parent
cced9028
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
4 deletions
+29
-4
Record.php
lib/Doctrine/Record.php
+1
-1
Table.php
lib/Doctrine/Table.php
+28
-3
No files found.
lib/Doctrine/Record.php
View file @
0b3a3c38
...
...
@@ -1538,7 +1538,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
*/
public
function
index
(
$name
,
array
$definition
=
array
())
{
if
(
!
$
columns
)
{
if
(
!
$
definition
)
{
return
$this
->
_table
->
getIndex
(
$name
);
}
else
{
return
$this
->
_table
->
addIndex
(
$name
,
$definition
);
...
...
lib/Doctrine/Table.php
View file @
0b3a3c38
...
...
@@ -136,13 +136,13 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
* -- inheritanceMap inheritanceMap is used for inheritance mapping, keys representing columns and values
* the column values that should correspond to child classes
*
* --
engine database engin
e (mysql example: INNODB)
* --
type table typ
e (mysql example: INNODB)
*
* -- charset character set
*
* -- collation
*
* -- index
the index definitions of this table
* -- index
es
the index definitions of this table
*
* -- treeImpl the tree implementation of this table (if any)
*
...
...
@@ -158,7 +158,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
'collation'
=>
null
,
'treeImpl'
=>
null
,
'treeOptions'
=>
null
,
'index
'
=>
array
(),
'index
es'
=>
array
(),
);
/**
* @var Doctrine_Tree $tree tree object associated with this table
...
...
@@ -412,6 +412,31 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
{
return
isset
(
$this
->
options
[
$option
]);
}
/**
* addIndex
*
* adds an index to this table
*
* @return void
*/
public
function
addIndex
(
$index
,
array
$definition
)
{
$index
=
$this
->
conn
->
getIndexName
(
$index
);
$this
->
options
[
'indexes'
][
$index
]
=
$definition
;
}
/**
* getIndex
*
* @return array|boolean array on success, FALSE on failure
*/
public
function
getIndex
(
$index
)
{
if
(
isset
(
$this
->
options
[
'indexes'
][
$index
]))
{
return
$this
->
options
[
'indexes'
][
$index
];
}
return
false
;
}
/**
* createQuery
* creates a new Doctrine_Query object and adds the component name
...
...
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