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
ad0f3898
Commit
ad0f3898
authored
May 11, 2007
by
lsmith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- added ability to set scale at runtime
parent
fd0c1107
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
9 deletions
+15
-9
Firebird.php
lib/Doctrine/DataDict/Firebird.php
+2
-1
Mssql.php
lib/Doctrine/DataDict/Mssql.php
+2
-1
Mysql.php
lib/Doctrine/DataDict/Mysql.php
+2
-1
Oracle.php
lib/Doctrine/DataDict/Oracle.php
+2
-1
Pgsql.php
lib/Doctrine/DataDict/Pgsql.php
+4
-3
Sqlite.php
lib/Doctrine/DataDict/Sqlite.php
+3
-2
No files found.
lib/Doctrine/DataDict/Firebird.php
View file @
ad0f3898
...
...
@@ -93,7 +93,8 @@ class Doctrine_DataDict_Firebird extends Doctrine_DataDict
return
'DOUBLE PRECISION'
;
case
'decimal'
:
$length
=
!
empty
(
$field
[
'length'
])
?
$field
[
'length'
]
:
18
;
return
'DECIMAL('
.
$length
.
','
.
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_DECIMAL_PLACES
)
.
')'
;
$scale
=
!
empty
(
$field
[
'scale'
])
?
$field
[
'scale'
]
:
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_DECIMAL_PLACES
);
return
'DECIMAL('
.
$length
.
','
.
$scale
.
')'
;
}
throw
new
Doctrine_DataDict_Exception
(
'Unknown field type \''
.
$field
[
'type'
]
.
'\'.'
);
...
...
lib/Doctrine/DataDict/Mssql.php
View file @
ad0f3898
...
...
@@ -108,7 +108,8 @@ class Doctrine_DataDict_Mssql extends Doctrine_DataDict
return
'FLOAT'
;
case
'decimal'
:
$length
=
!
empty
(
$field
[
'length'
])
?
$field
[
'length'
]
:
18
;
return
'DECIMAL('
.
$length
.
','
.
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_DECIMAL_PLACES
)
.
')'
;
$scale
=
!
empty
(
$field
[
'scale'
])
?
$field
[
'scale'
]
:
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_DECIMAL_PLACES
);
return
'DECIMAL('
.
$length
.
','
.
$scale
.
')'
;
}
throw
new
Doctrine_DataDict_Exception
(
'Unknown field type \''
.
$field
[
'type'
]
.
'\'.'
);
...
...
lib/Doctrine/DataDict/Mysql.php
View file @
ad0f3898
...
...
@@ -216,7 +216,8 @@ class Doctrine_DataDict_Mysql extends Doctrine_DataDict
return
'DOUBLE'
;
case
'decimal'
:
$length
=
!
empty
(
$field
[
'length'
])
?
$field
[
'length'
]
:
18
;
return
'DECIMAL('
.
$length
.
','
.
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_DECIMAL_PLACES
)
.
')'
;
$scale
=
!
empty
(
$field
[
'scale'
])
?
$field
[
'scale'
]
:
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_DECIMAL_PLACES
);
return
'DECIMAL('
.
$length
.
','
.
$scale
.
')'
;
}
throw
new
Doctrine_DataDict_Exception
(
'Unknown field type \''
.
$field
[
'type'
]
.
'\'.'
);
}
...
...
lib/Doctrine/DataDict/Oracle.php
View file @
ad0f3898
...
...
@@ -92,7 +92,8 @@ class Doctrine_DataDict_Oracle extends Doctrine_DataDict
case
'double'
:
return
'NUMBER'
;
case
'decimal'
:
return
'NUMBER(*,'
.
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_DECIMAL_PLACES
)
.
')'
;
$scale
=
!
empty
(
$field
[
'scale'
])
?
$field
[
'scale'
]
:
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_DECIMAL_PLACES
);
return
'NUMBER(*,'
.
$scale
.
')'
;
default
:
}
throw
new
Doctrine_DataDict_Exception
(
'Unknown field type \''
.
$field
[
'type'
]
.
'\'.'
);
...
...
lib/Doctrine/DataDict/Pgsql.php
View file @
ad0f3898
...
...
@@ -417,7 +417,8 @@ class Doctrine_DataDict_Pgsql extends Doctrine_DataDict
return
'FLOAT8'
;
case
'decimal'
:
$length
=
!
empty
(
$field
[
'length'
])
?
$field
[
'length'
]
:
18
;
return
'NUMERIC('
.
$length
.
','
.
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_DECIMAL_PLACES
)
.
')'
;
$scale
=
!
empty
(
$field
[
'scale'
])
?
$field
[
'scale'
]
:
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_DECIMAL_PLACES
);
return
'NUMERIC('
.
$length
.
','
.
$scale
.
')'
;
}
throw
new
Doctrine_DataDict_Exception
(
'Unknown field type \''
.
$field
[
'type'
]
.
'\'.'
);
}
...
...
@@ -548,7 +549,7 @@ class Doctrine_DataDict_Pgsql extends Doctrine_DataDict
return
array
(
'type'
=>
$type
,
'length'
=>
$length
,
'unsigned'
=>
$unsigned
,
'unsigned'
=>
$unsigned
,
'fixed'
=>
$fixed
);
}
/**
...
...
@@ -606,7 +607,7 @@ class Doctrine_DataDict_Pgsql extends Doctrine_DataDict
}
/**
* parseBoolean
* parses a literal boolean value and returns
* parses a literal boolean value and returns
* proper sql equivalent
*
* @param string $value boolean value to be parsed
...
...
lib/Doctrine/DataDict/Sqlite.php
View file @
ad0f3898
...
...
@@ -115,7 +115,8 @@ class Doctrine_DataDict_Sqlite extends Doctrine_DataDict
//($this->conn->options['fixed_float']+2).','.$this->conn->options['fixed_float'].')' : '');
case
'decimal'
:
$length
=
!
empty
(
$field
[
'length'
])
?
$field
[
'length'
]
:
18
;
return
'DECIMAL('
.
$length
.
','
.
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_DECIMAL_PLACES
)
.
')'
;
$scale
=
!
empty
(
$field
[
'scale'
])
?
$field
[
'scale'
]
:
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_DECIMAL_PLACES
);
return
'DECIMAL('
.
$length
.
','
.
$scale
.
')'
;
}
throw
new
Doctrine_DataDict_Exception
(
'Unknown field type \''
.
$field
[
'type'
]
.
'\'.'
);
}
...
...
@@ -237,7 +238,7 @@ class Doctrine_DataDict_Sqlite extends Doctrine_DataDict
return
array
(
'type'
=>
$type
,
'length'
=>
$length
,
'unsigned'
=>
$unsigned
,
'unsigned'
=>
$unsigned
,
'fixed'
=>
$fixed
);
}
/**
...
...
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