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
d76814c8
Commit
d76814c8
authored
Jun 26, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed Doctrine_Identifier
parent
4add4697
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
60 deletions
+10
-60
UnitOfWork.php
lib/Doctrine/Connection/UnitOfWork.php
+1
-1
Identifier.php
lib/Doctrine/Identifier.php
+0
-50
Record.php
lib/Doctrine/Record.php
+4
-4
Table.php
lib/Doctrine/Table.php
+5
-5
No files found.
lib/Doctrine/Connection/UnitOfWork.php
View file @
d76814c8
...
@@ -411,7 +411,7 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module
...
@@ -411,7 +411,7 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module
$this
->
conn
->
insert
(
$table
->
getTableName
(),
$array
);
$this
->
conn
->
insert
(
$table
->
getTableName
(),
$array
);
if
(
empty
(
$seq
)
&&
count
(
$keys
)
==
1
&&
$keys
[
0
]
==
$table
->
getIdentifier
()
&&
if
(
empty
(
$seq
)
&&
count
(
$keys
)
==
1
&&
$keys
[
0
]
==
$table
->
getIdentifier
()
&&
$table
->
getIdentifierType
()
!=
Doctrine
_Identifier
::
NORM
AL
)
{
$table
->
getIdentifierType
()
!=
Doctrine
::
IDENTIFIER_NATUR
AL
)
{
if
(
strtolower
(
$this
->
conn
->
getName
())
==
'pgsql'
)
{
if
(
strtolower
(
$this
->
conn
->
getName
())
==
'pgsql'
)
{
$seq
=
$table
->
getTableName
()
.
'_'
.
$keys
[
0
];
$seq
=
$table
->
getTableName
()
.
'_'
.
$keys
[
0
];
...
...
lib/Doctrine/Identifier.php
deleted
100644 → 0
View file @
4add4697
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.com>.
*/
/**
* Doctrine_Identifier
*
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @package Doctrine
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @category Object Relational Mapping
* @link www.phpdoctrine.com
* @since 1.0
* @version $Revision$
*/
class
Doctrine_Identifier
{
/**
* constant for auto_increment identifier
*/
const
AUTO_INCREMENT
=
1
;
/**
* constant for sequence identifier
*/
const
SEQUENCE
=
2
;
/**
* constant for normal identifier
*/
const
NORMAL
=
3
;
/**
* constant for composite identifier
*/
const
COMPOSITE
=
4
;
}
lib/Doctrine/Record.php
View file @
d76814c8
...
@@ -429,8 +429,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
...
@@ -429,8 +429,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
private
function
prepareIdentifiers
(
$exists
=
true
)
private
function
prepareIdentifiers
(
$exists
=
true
)
{
{
switch
(
$this
->
_table
->
getIdentifierType
())
{
switch
(
$this
->
_table
->
getIdentifierType
())
{
case
Doctrine
_Identifier
::
AUTO_INCREMENT
:
case
Doctrine
::
IDENTIFIER_AUTOINC
:
case
Doctrine
_Identifier
::
SEQUENCE
:
case
Doctrine
::
IDENTIFIER_
SEQUENCE
:
$name
=
$this
->
_table
->
getIdentifier
();
$name
=
$this
->
_table
->
getIdentifier
();
if
(
$exists
)
{
if
(
$exists
)
{
...
@@ -442,7 +442,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
...
@@ -442,7 +442,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
unset
(
$this
->
_data
[
$name
]);
unset
(
$this
->
_data
[
$name
]);
break
;
break
;
case
Doctrine
_Identifier
::
NORM
AL
:
case
Doctrine
::
IDENTIFIER_NATUR
AL
:
$this
->
_id
=
array
();
$this
->
_id
=
array
();
$name
=
$this
->
_table
->
getIdentifier
();
$name
=
$this
->
_table
->
getIdentifier
();
...
@@ -450,7 +450,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
...
@@ -450,7 +450,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
$this
->
_id
[
$name
]
=
$this
->
_data
[
$name
];
$this
->
_id
[
$name
]
=
$this
->
_data
[
$name
];
}
}
break
;
break
;
case
Doctrine
_Identifier
::
COMPOSITE
:
case
Doctrine
::
IDENTIFIER_
COMPOSITE
:
$names
=
$this
->
_table
->
getIdentifier
();
$names
=
$this
->
_table
->
getIdentifier
();
foreach
(
$names
as
$name
)
{
foreach
(
$names
as
$name
)
{
...
...
lib/Doctrine/Table.php
View file @
d76814c8
...
@@ -241,13 +241,13 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
...
@@ -241,13 +241,13 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
$this
->
primaryKeys
[]
=
'id'
;
$this
->
primaryKeys
[]
=
'id'
;
$this
->
identifier
=
'id'
;
$this
->
identifier
=
'id'
;
$this
->
identifierType
=
Doctrine
_Identifier
::
AUTO_INCREMENT
;
$this
->
identifierType
=
Doctrine
::
IDENTIFIER_AUTOINC
;
$this
->
columnCount
++
;
$this
->
columnCount
++
;
break
;
break
;
default
:
default
:
if
(
count
(
$this
->
primaryKeys
)
>
1
)
{
if
(
count
(
$this
->
primaryKeys
)
>
1
)
{
$this
->
identifier
=
$this
->
primaryKeys
;
$this
->
identifier
=
$this
->
primaryKeys
;
$this
->
identifierType
=
Doctrine
_Identifier
::
COMPOSITE
;
$this
->
identifierType
=
Doctrine
::
IDENTIFIER_
COMPOSITE
;
}
else
{
}
else
{
foreach
(
$this
->
primaryKeys
as
$pk
)
{
foreach
(
$this
->
primaryKeys
as
$pk
)
{
...
@@ -264,12 +264,12 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
...
@@ -264,12 +264,12 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
switch
(
strtolower
(
$e2
[
0
]))
{
switch
(
strtolower
(
$e2
[
0
]))
{
case
'autoincrement'
:
case
'autoincrement'
:
case
'autoinc'
:
case
'autoinc'
:
$this
->
identifierType
=
Doctrine
_Identifier
::
AUTO_INCREMENT
;
$this
->
identifierType
=
Doctrine
::
IDENTIFIER_AUTOINC
;
$found
=
true
;
$found
=
true
;
break
;
break
;
case
'seq'
:
case
'seq'
:
case
'sequence'
:
case
'sequence'
:
$this
->
identifierType
=
Doctrine
_Identifier
::
SEQUENCE
;
$this
->
identifierType
=
Doctrine
::
IDENTIFIER_
SEQUENCE
;
$found
=
true
;
$found
=
true
;
if
(
$value
)
{
if
(
$value
)
{
...
@@ -285,7 +285,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
...
@@ -285,7 +285,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
}
}
}
}
if
(
!
isset
(
$this
->
identifierType
))
{
if
(
!
isset
(
$this
->
identifierType
))
{
$this
->
identifierType
=
Doctrine
_Identifier
::
NORM
AL
;
$this
->
identifierType
=
Doctrine
::
IDENTIFIER_NATUR
AL
;
}
}
$this
->
identifier
=
$pk
;
$this
->
identifier
=
$pk
;
}
}
...
...
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