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
6d8003c3
Commit
6d8003c3
authored
Jun 10, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
made Firebird adhere to strict standards
parent
b70f6cd7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
Firebird.php
lib/Doctrine/Export/Firebird.php
+14
-14
No files found.
lib/Doctrine/Export/Firebird.php
View file @
6d8003c3
...
...
@@ -147,7 +147,7 @@ class Doctrine_Export_Firebird extends Doctrine_Export
*
* @return void
*/
public
function
createTable
(
$name
,
$fields
,
$options
=
array
())
{
public
function
createTable
(
$name
,
array
$fields
,
array
$options
=
array
())
{
parent
::
createTable
(
$name
,
$fields
,
$options
);
// TODO ? $this->_silentCommit();
...
...
@@ -300,10 +300,10 @@ class Doctrine_Export_Firebird extends Doctrine_Export
* actually perform them otherwise.
* @return void
*/
public
function
alterTable
(
$name
,
$changes
,
$check
)
public
function
alterTable
(
$name
,
array
$changes
,
$check
)
{
foreach
(
$changes
as
$change
_n
ame
=>
$change
)
{
switch
(
$change
_n
ame
)
{
foreach
(
$changes
as
$change
N
ame
=>
$change
)
{
switch
(
$change
N
ame
)
{
case
'add'
:
case
'remove'
:
case
'rename'
:
...
...
@@ -314,7 +314,7 @@ class Doctrine_Export_Firebird extends Doctrine_Export
}
break
;
default
:
throw
new
Doctrine_DataDict_Exception
(
'change type '
.
$change
_n
ame
.
' not yet supported'
);
throw
new
Doctrine_DataDict_Exception
(
'change type '
.
$change
N
ame
.
' not yet supported'
);
}
}
if
(
$check
)
{
...
...
@@ -322,11 +322,11 @@ class Doctrine_Export_Firebird extends Doctrine_Export
}
$query
=
''
;
if
(
!
empty
(
$changes
[
'add'
])
&&
is_array
(
$changes
[
'add'
]))
{
foreach
(
$changes
[
'add'
]
as
$field
_n
ame
=>
$field
)
{
foreach
(
$changes
[
'add'
]
as
$field
N
ame
=>
$field
)
{
if
(
$query
)
{
$query
.=
', '
;
}
$query
.=
'ADD '
.
$this
->
getDeclaration
(
$field
[
'type'
],
$field
_n
ame
,
$field
,
$name
);
$query
.=
'ADD '
.
$this
->
getDeclaration
(
$field
[
'type'
],
$field
N
ame
,
$field
,
$name
);
}
}
...
...
@@ -352,13 +352,13 @@ class Doctrine_Export_Firebird extends Doctrine_Export
if
(
!
empty
(
$changes
[
'change'
])
&&
is_array
(
$changes
[
'change'
]))
{
// missing support to change DEFAULT and NULLability
foreach
(
$changes
[
'change'
]
as
$field
_n
ame
=>
$field
)
{
foreach
(
$changes
[
'change'
]
as
$field
N
ame
=>
$field
)
{
$this
->
checkSupportedChanges
(
$field
);
if
(
$query
)
{
$query
.=
', '
;
}
$this
->
conn
->
loadModule
(
'Datatype'
,
null
,
true
);
$field_name
=
$this
->
conn
->
quoteIdentifier
(
$field
_n
ame
,
true
);
$field_name
=
$this
->
conn
->
quoteIdentifier
(
$field
N
ame
,
true
);
$query
.=
'ALTER '
.
$field_name
.
' TYPE '
.
$this
->
getTypeDeclaration
(
$field
[
'definition'
]);
}
}
...
...
@@ -368,7 +368,7 @@ class Doctrine_Export_Firebird extends Doctrine_Export
}
$name
=
$this
->
conn
->
quoteIdentifier
(
$name
,
true
);
$result
=
$this
->
conn
->
exec
(
"ALTER TABLE
$name
$query
"
);
$result
=
$this
->
conn
->
exec
(
'ALTER TABLE '
.
$name
.
' '
.
$query
);
$this
->
_silentCommit
();
return
$result
;
}
...
...
@@ -421,7 +421,7 @@ class Doctrine_Export_Firebird extends Doctrine_Export
}
}
$table
=
$this
->
conn
->
quoteIdentifier
(
$table
,
true
);
$name
=
$this
->
conn
->
quoteIdentifier
(
$this
->
conn
->
getIndexName
(
$name
),
true
);
$name
=
$this
->
conn
->
quoteIdentifier
(
$this
->
conn
->
formatter
->
getIndexName
(
$name
),
true
);
$query
.=
$query_sort
.
' INDEX '
.
$name
.
' ON '
.
$table
;
$fields
=
array
();
foreach
(
array_keys
(
$definition
[
'fields'
])
as
$field
)
{
...
...
@@ -459,7 +459,7 @@ class Doctrine_Export_Firebird extends Doctrine_Export
$table
=
$this
->
conn
->
quoteIdentifier
(
$table
,
true
);
if
(
!
empty
(
$name
))
{
$name
=
$this
->
conn
->
quoteIdentifier
(
$this
->
conn
->
getIndexName
(
$name
),
true
);
$name
=
$this
->
conn
->
quoteIdentifier
(
$this
->
conn
->
formatter
->
getIndexName
(
$name
),
true
);
}
$query
=
"ALTER TABLE
$table
ADD"
;
if
(
!
empty
(
$definition
[
'primary'
]))
{
...
...
@@ -491,7 +491,7 @@ class Doctrine_Export_Firebird extends Doctrine_Export
*/
public
function
createSequence
(
$seqName
,
$start
=
1
)
{
$sequenceName
=
$this
->
conn
->
getSequenceName
(
$seqName
);
$sequenceName
=
$this
->
conn
->
formatter
->
getSequenceName
(
$seqName
);
$this
->
conn
->
exec
(
'CREATE GENERATOR '
.
$sequenceName
);
...
...
@@ -507,7 +507,7 @@ class Doctrine_Export_Firebird extends Doctrine_Export
*/
public
function
dropSequence
(
$seqName
)
{
$sequenceName
=
$this
->
conn
->
getSequenceName
(
$seqName
);
$sequenceName
=
$this
->
conn
->
formatter
->
getSequenceName
(
$seqName
);
$sequenceName
=
$this
->
conn
->
quote
(
$sequenceName
);
$query
=
"DELETE FROM RDB
\$
GENERATORS WHERE UPPER(RDB
\$
GENERATOR_NAME)="
.
$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