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
efc7baa1
Commit
efc7baa1
authored
May 11, 2007
by
lsmith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- use ATTR_DECIMAL_PLACES when defining a decimal field
parent
4d1722fb
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
17 deletions
+19
-17
Firebird.php
lib/Doctrine/DataDict/Firebird.php
+3
-3
Mssql.php
lib/Doctrine/DataDict/Mssql.php
+2
-2
Mysql.php
lib/Doctrine/DataDict/Mysql.php
+3
-2
Oracle.php
lib/Doctrine/DataDict/Oracle.php
+2
-2
Manager.php
lib/Doctrine/Manager.php
+9
-8
No files found.
lib/Doctrine/DataDict/Firebird.php
View file @
efc7baa1
...
@@ -93,7 +93,7 @@ class Doctrine_DataDict_Firebird extends Doctrine_DataDict
...
@@ -93,7 +93,7 @@ class Doctrine_DataDict_Firebird extends Doctrine_DataDict
return
'DOUBLE PRECISION'
;
return
'DOUBLE PRECISION'
;
case
'decimal'
:
case
'decimal'
:
$length
=
!
empty
(
$field
[
'length'
])
?
$field
[
'length'
]
:
18
;
$length
=
!
empty
(
$field
[
'length'
])
?
$field
[
'length'
]
:
18
;
return
'DECIMAL('
.
$length
.
','
.
$this
->
conn
->
options
[
'decimal_places'
]
.
')'
;
return
'DECIMAL('
.
$length
.
','
.
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_DECIMAL_PLACES
)
.
')'
;
}
}
throw
new
Doctrine_DataDict_Exception
(
'Unknown field type \''
.
$field
[
'type'
]
.
'\'.'
);
throw
new
Doctrine_DataDict_Exception
(
'Unknown field type \''
.
$field
[
'type'
]
.
'\'.'
);
...
...
lib/Doctrine/DataDict/Mssql.php
View file @
efc7baa1
...
@@ -108,7 +108,7 @@ class Doctrine_DataDict_Mssql extends Doctrine_DataDict
...
@@ -108,7 +108,7 @@ class Doctrine_DataDict_Mssql extends Doctrine_DataDict
return
'FLOAT'
;
return
'FLOAT'
;
case
'decimal'
:
case
'decimal'
:
$length
=
!
empty
(
$field
[
'length'
])
?
$field
[
'length'
]
:
18
;
$length
=
!
empty
(
$field
[
'length'
])
?
$field
[
'length'
]
:
18
;
return
'DECIMAL('
.
$length
.
','
.
$this
->
conn
->
options
[
'decimal_places'
]
.
')'
;
return
'DECIMAL('
.
$length
.
','
.
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_DECIMAL_PLACES
)
.
')'
;
}
}
throw
new
Doctrine_DataDict_Exception
(
'Unknown field type \''
.
$field
[
'type'
]
.
'\'.'
);
throw
new
Doctrine_DataDict_Exception
(
'Unknown field type \''
.
$field
[
'type'
]
.
'\'.'
);
...
...
lib/Doctrine/DataDict/Mysql.php
View file @
efc7baa1
...
@@ -216,7 +216,8 @@ class Doctrine_DataDict_Mysql extends Doctrine_DataDict
...
@@ -216,7 +216,8 @@ class Doctrine_DataDict_Mysql extends Doctrine_DataDict
return
'DOUBLE'
;
return
'DOUBLE'
;
case
'decimal'
:
case
'decimal'
:
$length
=
!
empty
(
$field
[
'length'
])
?
$field
[
'length'
]
:
18
;
$length
=
!
empty
(
$field
[
'length'
])
?
$field
[
'length'
]
:
18
;
return
'DECIMAL('
.
$length
.
','
.
0
.
')'
;
//$this->dbh->options['decimal_places'] . ')';
var_dump
(
'DECIMAL('
.
$length
.
','
.
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_DECIMAL_PLACES
)
.
')'
);
return
'DECIMAL('
.
$length
.
','
.
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_DECIMAL_PLACES
)
.
')'
;
}
}
throw
new
Doctrine_DataDict_Exception
(
'Unknown field type \''
.
$field
[
'type'
]
.
'\'.'
);
throw
new
Doctrine_DataDict_Exception
(
'Unknown field type \''
.
$field
[
'type'
]
.
'\'.'
);
}
}
...
...
lib/Doctrine/DataDict/Oracle.php
View file @
efc7baa1
...
@@ -92,7 +92,7 @@ class Doctrine_DataDict_Oracle extends Doctrine_DataDict
...
@@ -92,7 +92,7 @@ class Doctrine_DataDict_Oracle extends Doctrine_DataDict
case
'double'
:
case
'double'
:
return
'NUMBER'
;
return
'NUMBER'
;
case
'decimal'
:
case
'decimal'
:
return
'NUMBER(*,'
.
$this
->
conn
->
options
[
'decimal_places'
]
.
')'
;
return
'NUMBER(*,'
.
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_DECIMAL_PLACES
)
.
')'
;
default
:
default
:
}
}
throw
new
Doctrine_DataDict_Exception
(
'Unknown field type \''
.
$field
[
'type'
]
.
'\'.'
);
throw
new
Doctrine_DataDict_Exception
(
'Unknown field type \''
.
$field
[
'type'
]
.
'\'.'
);
...
...
lib/Doctrine/Manager.php
View file @
efc7baa1
...
@@ -115,6 +115,7 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
...
@@ -115,6 +115,7 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
Doctrine
::
ATTR_SEQCOL_NAME
=>
'id'
,
Doctrine
::
ATTR_SEQCOL_NAME
=>
'id'
,
Doctrine
::
ATTR_PORTABILITY
=>
Doctrine
::
PORTABILITY_ALL
,
Doctrine
::
ATTR_PORTABILITY
=>
Doctrine
::
PORTABILITY_ALL
,
Doctrine
::
ATTR_EXPORT
=>
Doctrine
::
EXPORT_NONE
,
Doctrine
::
ATTR_EXPORT
=>
Doctrine
::
EXPORT_NONE
,
Doctrine
::
ATTR_DECIMAL_PLACES
=>
2
,
);
);
foreach
(
$attributes
as
$attribute
=>
$value
)
{
foreach
(
$attributes
as
$attribute
=>
$value
)
{
$old
=
$this
->
getAttribute
(
$attribute
);
$old
=
$this
->
getAttribute
(
$attribute
);
...
...
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