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
0bafdb66
Commit
0bafdb66
authored
Jan 10, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor fixes
parent
2bdb6860
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
10 deletions
+10
-10
Export.php
lib/Doctrine/Export.php
+1
-1
Mysql.php
lib/Doctrine/Export/Mysql.php
+5
-5
Sqlite.php
lib/Doctrine/Sequence/Sqlite.php
+4
-4
No files found.
lib/Doctrine/Export.php
View file @
0bafdb66
...
...
@@ -161,7 +161,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
* @param string $start start value of the sequence; default is 1
* @return void
*/
public
function
createSequence
(
$seqName
,
$s
eqcolName
,
$s
tart
=
1
)
public
function
createSequence
(
$seqName
,
$start
=
1
)
{
throw
new
Doctrine_Export_Exception
(
'Create sequence not supported by this driver.'
);
}
...
...
lib/Doctrine/Export/Mysql.php
View file @
0bafdb66
...
...
@@ -320,13 +320,13 @@ class Doctrine_Export_Mysql extends Doctrine_Export
* @param string $start start value of the sequence; default is 1
* @return boolean
*/
public
function
createSequence
(
$sequenceName
,
$seqcol
_n
ame
,
$start
=
1
)
public
function
createSequence
(
$sequenceName
,
$seqcol
N
ame
,
$start
=
1
)
{
$query
=
'CREATE TABLE '
.
$sequenceName
.
' ('
.
$seqcol
_n
ame
.
' INT NOT NULL AUTO_INCREMENT, PRIMARY KEY ('
.
' ('
.
$seqcol
N
ame
.
' INT NOT NULL AUTO_INCREMENT, PRIMARY KEY ('
.
$seqcol_name
.
'))'
.
strlen
(
$this
->
dbh
->
options
[
'default_table_type'
]
)
?
' TYPE = '
.
$this
->
dbh
->
options
[
'default_table_type'
]
:
''
;
.
strlen
(
$this
->
conn
->
default_table_type
)
?
' TYPE = '
.
$this
->
conn
->
default_table_type
:
''
;
$res
=
$this
->
conn
->
exec
(
$query
);
...
...
@@ -334,7 +334,7 @@ class Doctrine_Export_Mysql extends Doctrine_Export
return
true
;
$query
=
'INSERT INTO '
.
$sequenceName
.
' ('
.
$seqcol_name
.
') VALUES ('
.
(
$start
-
1
)
.
')'
;
.
' ('
.
$seqcol_name
.
') VALUES ('
.
(
$start
-
1
)
.
')'
;
$res
=
$this
->
conn
->
exec
(
$query
);
...
...
lib/Doctrine/Sequence/Sqlite.php
View file @
0bafdb66
...
...
@@ -40,7 +40,7 @@ class Doctrine_Sequence_Sqlite extends Doctrine_Sequence
*
* @return integer next id in the given sequence
*/
public
function
nextI
D
(
$seqName
,
$onDemand
=
true
)
public
function
nextI
d
(
$seqName
,
$onDemand
=
true
)
{
$sequenceName
=
$this
->
conn
->
quoteIdentifier
(
$this
->
conn
->
getSequenceName
(
$seqName
),
true
);
$seqcolName
=
$this
->
conn
->
quoteIdentifier
(
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_SEQCOL_NAME
),
true
);
...
...
@@ -52,7 +52,7 @@ class Doctrine_Sequence_Sqlite extends Doctrine_Sequence
$this
->
conn
->
exec
(
$query
);
}
catch
(
Doctrine_Connection_Exception
$e
)
{
if
(
$onDemand
&&
$
result
->
getPortableCode
()
==
Doctrine
::
ERR_NOSUCHTABLE
)
{
if
(
$onDemand
&&
$
e
->
getPortableCode
()
==
Doctrine
::
ERR_NOSUCHTABLE
)
{
// Since we are creating the sequence on demand
// we know the first id = 1 so initialize the
// sequence at 2
...
...
@@ -89,7 +89,7 @@ class Doctrine_Sequence_Sqlite extends Doctrine_Sequence
* @param string name of the field into which a new row was inserted
* @return integer|boolean
*/
public
function
lastInsertI
D
(
$table
=
null
,
$field
=
null
)
public
function
lastInsertI
d
(
$table
=
null
,
$field
=
null
)
{
return
$this
->
conn
->
getDbh
()
->
lastInsertID
();
}
...
...
@@ -100,7 +100,7 @@ class Doctrine_Sequence_Sqlite extends Doctrine_Sequence
*
* @return integer current id in the given sequence
*/
public
function
currI
D
(
$seqName
)
public
function
currI
d
(
$seqName
)
{
$sequenceName
=
$this
->
conn
->
quoteIdentifier
(
$this
->
conn
->
getSequenceName
(
$seqName
),
true
);
$seqcolName
=
$this
->
conn
->
quoteIdentifier
(
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_SEQCOL_NAME
),
true
);
...
...
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