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
b71ac561
Commit
b71ac561
authored
Apr 18, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enhanced error handling
parent
26a723e8
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
30 additions
and
12 deletions
+30
-12
Firebird.php
lib/Doctrine/DataDict/Firebird.php
+6
-3
Informix.php
lib/Doctrine/DataDict/Informix.php
+4
-1
Mssql.php
lib/Doctrine/DataDict/Mssql.php
+5
-1
Mysql.php
lib/Doctrine/DataDict/Mysql.php
+3
-3
Oracle.php
lib/Doctrine/DataDict/Oracle.php
+4
-1
Pgsql.php
lib/Doctrine/DataDict/Pgsql.php
+4
-2
Sqlite.php
lib/Doctrine/DataDict/Sqlite.php
+4
-1
No files found.
lib/Doctrine/DataDict/Firebird.php
View file @
b71ac561
...
...
@@ -57,6 +57,9 @@ class Doctrine_DataDict_Firebird extends Doctrine_DataDict
*/
public
function
getNativeDeclaration
(
$field
)
{
if
(
!
isset
(
$field
[
'type'
]))
{
throw
new
Doctrine_DataDict_Exception
(
'Missing column type.'
);
}
switch
(
$field
[
'type'
])
{
case
'varchar'
:
case
'string'
:
...
...
@@ -90,10 +93,10 @@ class Doctrine_DataDict_Firebird extends Doctrine_DataDict
return
'DOUBLE PRECISION'
;
case
'decimal'
:
$length
=
!
empty
(
$field
[
'length'
])
?
$field
[
'length'
]
:
18
;
return
'DECIMAL('
.
$length
.
','
.
$this
->
conn
->
options
[
'decimal_places'
]
.
')'
;
default
:
throw
new
Doctrine_DataDict_Exception
(
'Unknown field type '
.
$field
[
'type'
]);
return
'DECIMAL('
.
$length
.
','
.
$this
->
conn
->
options
[
'decimal_places'
]
.
')'
;
}
throw
new
Doctrine_DataDict_Exception
(
'Unknown field type \''
.
$field
[
'type'
]
.
'\'.'
);
}
/**
* Maps a native array description of a field to a Doctrine datatype and length
...
...
lib/Doctrine/DataDict/Informix.php
View file @
b71ac561
...
...
@@ -56,6 +56,9 @@ class Doctrine_DataDict_Informix extends Doctrine_DataDict
*/
public
function
getNativeDeclaration
(
$field
)
{
if
(
!
isset
(
$field
[
'type'
]))
{
throw
new
Doctrine_DataDict_Exception
(
'Missing column type.'
);
}
switch
(
$field
[
'type'
])
{
case
'char'
:
case
'varchar'
:
...
...
@@ -102,6 +105,6 @@ class Doctrine_DataDict_Informix extends Doctrine_DataDict
case
'decimal'
:
return
'DECIMAL'
;
}
return
''
;
throw
new
Doctrine_DataDict_Exception
(
'Unknown field type \''
.
$field
[
'type'
]
.
'\'.'
)
;
}
}
lib/Doctrine/DataDict/Mssql.php
View file @
b71ac561
...
...
@@ -59,6 +59,9 @@ class Doctrine_DataDict_Mssql extends Doctrine_DataDict
*/
public
function
getNativeDeclaration
(
$field
)
{
if
(
!
isset
(
$field
[
'type'
]))
{
throw
new
Doctrine_DataDict_Exception
(
'Missing column type.'
);
}
switch
(
$field
[
'type'
])
{
case
'array'
:
case
'object'
:
...
...
@@ -107,7 +110,8 @@ class Doctrine_DataDict_Mssql extends Doctrine_DataDict
$length
=
!
empty
(
$field
[
'length'
])
?
$field
[
'length'
]
:
18
;
return
'DECIMAL('
.
$length
.
','
.
$this
->
conn
->
options
[
'decimal_places'
]
.
')'
;
}
throw
new
Doctrine_DataDict_Exception
(
'Unknown column type.'
);
throw
new
Doctrine_DataDict_Exception
(
'Unknown field type \''
.
$field
[
'type'
]
.
'\'.'
);
}
/**
* Maps a native array description of a field to a MDB2 datatype and length
...
...
lib/Doctrine/DataDict/Mysql.php
View file @
b71ac561
...
...
@@ -135,7 +135,7 @@ class Doctrine_DataDict_Mysql extends Doctrine_DataDict
public
function
getNativeDeclaration
(
$field
)
{
if
(
!
isset
(
$field
[
'type'
]))
{
$field
[
'type'
]
=
null
;
throw
new
Doctrine_DataDict_Exception
(
'Missing column type.'
)
;
}
switch
(
$field
[
'type'
])
{
...
...
@@ -218,7 +218,7 @@ class Doctrine_DataDict_Mysql extends Doctrine_DataDict
$length
=
!
empty
(
$field
[
'length'
])
?
$field
[
'length'
]
:
18
;
return
'DECIMAL('
.
$length
.
','
.
0
.
')'
;
//$this->dbh->options['decimal_places'] . ')';
}
throw
new
Doctrine_DataDict_Exception
(
'Unknown
column type '
.
$field
[
'type'
]
.
'.'
);
throw
new
Doctrine_DataDict_Exception
(
'Unknown
field type \''
.
$field
[
'type'
]
.
'\
'.'
);
}
/**
* Maps a native array description of a field to a MDB2 datatype and length
...
...
@@ -367,7 +367,7 @@ class Doctrine_DataDict_Mysql extends Doctrine_DataDict
$length
=
null
;
break
;
default
:
throw
new
Doctrine_DataDict_Exception
(
'unknown database attribute type: '
.
$dbType
);
throw
new
Doctrine_DataDict_Exception
(
'unknown database attribute type: '
.
$dbType
);
}
$length
=
((
int
)
$length
==
0
)
?
null
:
(
int
)
$length
;
...
...
lib/Doctrine/DataDict/Oracle.php
View file @
b71ac561
...
...
@@ -55,6 +55,9 @@ class Doctrine_DataDict_Oracle extends Doctrine_DataDict
*/
public
function
getNativeDeclaration
(
array
$field
)
{
if
(
!
isset
(
$field
[
'type'
]))
{
throw
new
Doctrine_DataDict_Exception
(
'Missing column type.'
);
}
switch
(
$field
[
'type'
])
{
case
'string'
:
case
'array'
:
...
...
@@ -91,8 +94,8 @@ class Doctrine_DataDict_Oracle extends Doctrine_DataDict
case
'decimal'
:
return
'NUMBER(*,'
.
$this
->
conn
->
options
[
'decimal_places'
]
.
')'
;
default
:
throw
new
Doctrine_DataDict_Exception
(
'Unknown field type '
.
$field
[
'type'
]);
}
throw
new
Doctrine_DataDict_Exception
(
'Unknown field type \''
.
$field
[
'type'
]
.
'\'.'
);
}
/**
* Maps a native array description of a field to a doctrine datatype and length
...
...
lib/Doctrine/DataDict/Pgsql.php
View file @
b71ac561
...
...
@@ -360,6 +360,9 @@ class Doctrine_DataDict_Pgsql extends Doctrine_DataDict
*/
public
function
getNativeDeclaration
(
array
$field
)
{
if
(
!
isset
(
$field
[
'type'
]))
{
throw
new
Doctrine_DataDict_Exception
(
'Missing column type.'
);
}
switch
(
$field
[
'type'
])
{
case
'char'
:
case
'string'
:
...
...
@@ -415,9 +418,8 @@ class Doctrine_DataDict_Pgsql extends Doctrine_DataDict
case
'decimal'
:
$length
=
!
empty
(
$field
[
'length'
])
?
$field
[
'length'
]
:
18
;
return
'NUMERIC('
.
$length
.
','
.
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_DECIMAL_PLACES
)
.
')'
;
default
:
throw
new
Doctrine_DataDict_Exception
(
'Unknown field type '
.
$field
[
'type'
]);
}
throw
new
Doctrine_DataDict_Exception
(
'Unknown field type \''
.
$field
[
'type'
]
.
'\'.'
);
}
/**
* Maps a native array description of a field to a portable Doctrine datatype and length
...
...
lib/Doctrine/DataDict/Sqlite.php
View file @
b71ac561
...
...
@@ -57,6 +57,9 @@ class Doctrine_DataDict_Sqlite extends Doctrine_DataDict
*/
public
function
getNativeDeclaration
(
array
$field
)
{
if
(
!
isset
(
$field
[
'type'
]))
{
throw
new
Doctrine_DataDict_Exception
(
'Missing column type.'
);
}
switch
(
$field
[
'type'
])
{
case
'text'
:
case
'object'
:
...
...
@@ -114,7 +117,7 @@ class Doctrine_DataDict_Sqlite extends Doctrine_DataDict
$length
=
!
empty
(
$field
[
'length'
])
?
$field
[
'length'
]
:
18
;
return
'DECIMAL('
.
$length
.
','
.
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_DECIMAL_PLACES
)
.
')'
;
}
throw
new
Doctrine_DataDict_Exception
(
'Unknown
datatype '
.
$field
[
'type'
]
);
throw
new
Doctrine_DataDict_Exception
(
'Unknown
field type \''
.
$field
[
'type'
]
.
'\'.'
);
}
/**
* Maps a native array description of a field to Doctrine datatype and length
...
...
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