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
d1a1697a
Commit
d1a1697a
authored
Jun 13, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
E_STRICT fixes
parent
f8134df1
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
91 additions
and
33 deletions
+91
-33
Export.php
lib/Doctrine/Export.php
+39
-5
Firebird.php
lib/Doctrine/Export/Firebird.php
+10
-5
Mssql.php
lib/Doctrine/Export/Mssql.php
+14
-8
Oracle.php
lib/Doctrine/Export/Oracle.php
+14
-9
Pgsql.php
lib/Doctrine/Export/Pgsql.php
+14
-6
No files found.
lib/Doctrine/Export.php
View file @
d1a1697a
...
...
@@ -65,9 +65,21 @@ class Doctrine_Export extends Doctrine_Connection_Module
* @return void
*/
public
function
dropIndex
(
$table
,
$name
)
{
return
$this
->
conn
->
exec
(
$this
->
dropIndexSql
(
$table
,
$name
));
}
/**
* dropIndexSql
*
* @param string $table name of table that should be used in method
* @param string $name name of the index to be dropped
* @return string SQL that is used for dropping an index
*/
public
function
dropIndexSql
(
$table
,
$name
)
{
$name
=
$this
->
conn
->
quoteIdentifier
(
$this
->
conn
->
formatter
->
getIndexName
(
$name
));
return
$this
->
conn
->
exec
(
'DROP INDEX '
.
$name
)
;
return
'DROP INDEX '
.
$name
;
}
/**
* drop existing constraint
...
...
@@ -84,13 +96,27 @@ class Doctrine_Export extends Doctrine_Connection_Module
return
$this
->
conn
->
exec
(
'ALTER TABLE '
.
$table
.
' DROP CONSTRAINT '
.
$name
);
}
/**
* dropSequenceSql
* drop existing sequence
* (this method is implemented by the drivers)
*
* @param string $seq_name name of the sequence to be dropped
* @throws Doctrine_Connection_Exception if something fails at database level
* @param string $sequenceName name of the sequence to be dropped
* @return void
*/
public
function
dropSequence
(
$sequenceName
)
{
$this
->
conn
->
exec
(
$this
->
dropSequenceSql
(
$sequenceName
));
}
/**
* dropSequenceSql
* drop existing sequence
*
* @throws Doctrine_Connection_Exception if something fails at database level
* @param string $sequenceName name of the sequence to be dropped
* @return void
*/
public
function
dropSequence
(
$n
ame
)
public
function
dropSequence
Sql
(
$sequenceN
ame
)
{
throw
new
Doctrine_Export_Exception
(
'Drop sequence not supported by this driver.'
);
}
...
...
@@ -184,18 +210,26 @@ class Doctrine_Export extends Doctrine_Connection_Module
/**
* create sequence
*
* @throws Doctrine_Connection_Exception if something fails at database level
* @param string $seqName name of the sequence to be created
* @param string $start start value of the sequence; default is 1
* @param array $options An associative array of table options:
* array(
* 'comment' => 'Foo',
* 'charset' => 'utf8',
* 'collate' => 'utf8_unicode_ci',
* );
* @return void
*/
public
function
createSequence
(
$seqName
,
$start
=
1
)
public
function
createSequence
(
$seqName
,
$start
=
1
,
array
$options
=
array
()
)
{
return
$this
->
conn
->
execute
(
$this
->
createSequenceSql
(
$seqName
,
$start
=
1
));
return
$this
->
conn
->
execute
(
$this
->
createSequenceSql
(
$seqName
,
$start
=
1
,
$options
));
}
/**
* return RDBMS specific create sequence statement
* (this method is implemented by the drivers)
*
* @throws Doctrine_Connection_Exception if something fails at database level
* @param string $seqName name of the sequence to be created
* @param string $start start value of the sequence; default is 1
* @param array $options An associative array of table options:
...
...
lib/Doctrine/Export/Firebird.php
View file @
d1a1697a
...
...
@@ -498,14 +498,19 @@ class Doctrine_Export_Firebird extends Doctrine_Export
*
* @param string $seqName name of the sequence to be created
* @param string $start start value of the sequence; default is 1
* @return void
* @param array $options An associative array of table options:
* array(
* 'comment' => 'Foo',
* 'charset' => 'utf8',
* 'collate' => 'utf8_unicode_ci',
* );
* @return string
*/
public
function
createSequence
(
$seqName
,
$start
=
1
)
public
function
createSequence
(
$seqName
,
$start
=
1
,
array
$options
=
array
()
)
{
$sequenceName
=
$this
->
conn
->
formatter
->
getSequenceName
(
$seqName
);
$this
->
conn
->
exec
(
'CREATE GENERATOR '
.
$sequenceName
);
$this
->
conn
->
exec
(
'SET GENERATOR '
.
$sequenceName
.
' TO '
.
(
$start
-
1
));
$this
->
dropSequence
(
$seqName
);
...
...
@@ -516,12 +521,12 @@ class Doctrine_Export_Firebird extends Doctrine_Export
* @param string $seqName name of the sequence to be dropped
* @return void
*/
public
function
dropSequence
(
$seqName
)
public
function
dropSequence
Sql
(
$seqName
)
{
$sequenceName
=
$this
->
conn
->
formatter
->
getSequenceName
(
$seqName
);
$sequenceName
=
$this
->
conn
->
quote
(
$sequenceName
);
$query
=
"DELETE FROM RDB
\$
GENERATORS WHERE UPPER(RDB
\$
GENERATOR_NAME)="
.
$sequenceName
;
return
$
this
->
conn
->
exec
(
$query
)
;
return
$
query
;
}
}
lib/Doctrine/Export/Mssql.php
View file @
d1a1697a
...
...
@@ -208,16 +208,22 @@ class Doctrine_Export_Mssql extends Doctrine_Export
/**
* create sequence
*
* @param string $seqName name of the sequence to be created
* @param string $start start value of the sequence; default is 1
* @return void
* @param string $seqName name of the sequence to be created
* @param string $start start value of the sequence; default is 1
* @param array $options An associative array of table options:
* array(
* 'comment' => 'Foo',
* 'charset' => 'utf8',
* 'collate' => 'utf8_unicode_ci',
* );
* @return string
*/
public
function
createSequence
(
$seqName
,
$start
=
1
)
public
function
createSequence
(
$seqName
,
$start
=
1
,
array
$options
=
array
()
)
{
$sequenceName
=
$this
->
conn
->
quoteIdentifier
(
$this
->
conn
->
getSequenceName
(
$seqName
),
true
);
$seqcolName
=
$this
->
conn
->
quoteIdentifier
(
$this
->
conn
->
options
[
'seqcol_name'
],
true
);
$query
=
'CREATE TABLE '
.
$sequenceName
.
' ('
.
$seqcolName
.
' INT PRIMARY KEY CLUSTERED IDENTITY('
.
$start
.
',1) NOT NULL)'
;
$query
=
'CREATE TABLE '
.
$sequenceName
.
' ('
.
$seqcolName
.
' INT PRIMARY KEY CLUSTERED IDENTITY('
.
$start
.
',
1) NOT NULL)'
;
$res
=
$this
->
conn
->
exec
(
$query
);
...
...
@@ -240,9 +246,9 @@ class Doctrine_Export_Mssql extends Doctrine_Export
* @param string $seqName name of the sequence to be dropped
* @return void
*/
public
function
dropSequence
(
$seqName
)
public
function
dropSequence
Sql
(
$seqName
)
{
$sequenceName
=
$this
->
conn
->
quoteIdentifier
(
$this
->
conn
->
getSequenceName
(
$seqName
),
true
);
return
$this
->
conn
->
exec
(
'DROP TABLE '
.
$sequenceName
)
;
return
'DROP TABLE '
.
$sequenceName
;
}
}
lib/Doctrine/Export/Oracle.php
View file @
d1a1697a
...
...
@@ -432,28 +432,33 @@ END;
/**
* create sequence
*
* @param object $this->conn database object that is extended by this class
* @param string $seqName name of the sequence to be created
* @param string $start start value of the sequence; default is 1
* @return void
* @param array $options An associative array of table options:
* array(
* 'comment' => 'Foo',
* 'charset' => 'utf8',
* 'collate' => 'utf8_unicode_ci',
* );
* @return string
*/
public
function
createSequence
(
$seqName
,
$start
=
1
)
public
function
createSequence
Sql
(
$seqName
,
$start
=
1
,
array
$options
=
array
()
)
{
$sequenceName
=
$this
->
conn
->
quoteIdentifier
(
$this
->
conn
->
formatter
->
getSequenceName
(
$seqName
),
true
);
$query
=
'CREATE SEQUENCE '
.
$sequenceName
.
' START WITH '
.
$start
.
' INCREMENT BY 1 NOCACHE'
;
$query
.=
(
$start
<
1
?
' MINVALUE '
.
$start
:
''
);
return
$
this
->
conn
->
exec
(
$query
)
;
$query
=
'CREATE SEQUENCE '
.
$sequenceName
.
' START WITH '
.
$start
.
' INCREMENT BY 1 NOCACHE'
;
$query
.=
(
$start
<
1
?
' MINVALUE '
.
$start
:
''
);
return
$
query
;
}
/**
* drop existing sequence
*
* @param object $this->conn database object that is extended by this class
* @param string $seqName name of the sequence to be dropped
* @return
void
* @return
string
*/
public
function
dropSequence
(
$seqName
)
public
function
dropSequence
Sql
(
$seqName
)
{
$sequenceName
=
$this
->
conn
->
quoteIdentifier
(
$this
->
conn
->
formatter
->
getSequenceName
(
$seqName
),
true
);
return
$this
->
conn
->
exec
(
'DROP SEQUENCE '
.
$sequenceName
)
;
return
'DROP SEQUENCE '
.
$sequenceName
;
}
}
lib/Doctrine/Export/Pgsql.php
View file @
d1a1697a
...
...
@@ -251,12 +251,20 @@ class Doctrine_Export_Pgsql extends Doctrine_Export
}
}
/**
*
create sequence
*
return RDBMS specific create sequence statement
*
* @param string $sequenceName name of the sequence to be created
* @param string $start start value of the sequence; default is 1
* @throws Doctrine_Connection_Exception if something fails at database level
* @param string $seqName name of the sequence to be created
* @param string $start start value of the sequence; default is 1
* @param array $options An associative array of table options:
* array(
* 'comment' => 'Foo',
* 'charset' => 'utf8',
* 'collate' => 'utf8_unicode_ci',
* );
* @return string
*/
public
function
createSequence
(
$sequenceName
,
$start
=
1
)
public
function
createSequence
Sql
(
$sequenceName
,
$start
=
1
,
array
$options
=
array
()
)
{
$sequenceName
=
$this
->
conn
->
quoteIdentifier
(
$this
->
conn
->
formatter
->
getSequenceName
(
$sequenceName
),
true
);
return
$this
->
conn
->
exec
(
'CREATE SEQUENCE '
.
$sequenceName
.
' INCREMENT 1'
.
...
...
@@ -267,10 +275,10 @@ class Doctrine_Export_Pgsql extends Doctrine_Export
*
* @param string $sequenceName name of the sequence to be dropped
*/
public
function
dropSequence
(
$sequenceName
)
public
function
dropSequence
Sql
(
$sequenceName
)
{
$sequenceName
=
$this
->
conn
->
quoteIdentifier
(
$this
->
conn
->
formatter
->
getSequenceName
(
$sequenceName
),
true
);
return
$this
->
conn
->
exec
(
'DROP SEQUENCE '
.
$sequenceName
)
;
return
'DROP SEQUENCE '
.
$sequenceName
;
}
}
...
...
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