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
d5fd881c
Commit
d5fd881c
authored
Feb 19, 2010
by
beberlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.0] DDC-92 - Completly removed DoctrineException in DBAL package
parent
07e73880
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
5 deletions
+21
-5
DBALException.php
lib/Doctrine/DBAL/DBALException.php
+15
-0
Type.php
lib/Doctrine/DBAL/Types/Type.php
+6
-5
No files found.
lib/Doctrine/DBAL/DBALException.php
View file @
d5fd881c
...
...
@@ -70,4 +70,19 @@ class DBALException extends \Exception
{
return
new
self
(
"Invalid Offset in Limit Query, it has to be larger or equal to 0."
);
}
public
static
function
typeExists
(
$name
)
{
return
new
self
(
'Type '
.
$name
.
' already exists.'
);
}
public
static
function
unknownColumnType
(
$name
)
{
return
new
self
(
'Unknown column type '
.
$name
.
' requested.'
);
}
public
static
function
typeNotFound
(
$name
)
{
return
new
self
(
'Type to be overwritten '
.
$name
.
' does not exist.'
);
}
}
\ No newline at end of file
lib/Doctrine/DBAL/Types/Type.php
View file @
d5fd881c
...
...
@@ -115,6 +115,7 @@ abstract class Type
* Type instances are implemented as flyweights.
*
* @static
* @throws DBALException
* @param string $name The name of the type (as returned by getName()).
* @return Doctrine\DBAL\Types\Type
*/
...
...
@@ -122,7 +123,7 @@ abstract class Type
{
if
(
!
isset
(
self
::
$_typeObjects
[
$name
]))
{
if
(
!
isset
(
self
::
$_typesMap
[
$name
]))
{
throw
D
octrine
Exception
::
unknownColumnType
(
$name
);
throw
D
BAL
Exception
::
unknownColumnType
(
$name
);
}
self
::
$_typeObjects
[
$name
]
=
new
self
::
$_typesMap
[
$name
]();
...
...
@@ -138,12 +139,12 @@ abstract class Type
* @param string $name Name of the type. This should correspond to what
* getName() returns.
* @param string $className The class name of the custom type.
* @throws D
octrine
Exception
* @throws D
BAL
Exception
*/
public
static
function
addType
(
$name
,
$className
)
{
if
(
isset
(
self
::
$_typesMap
[
$name
]))
{
throw
D
octrine
Exception
::
typeExists
(
$name
);
throw
D
BAL
Exception
::
typeExists
(
$name
);
}
self
::
$_typesMap
[
$name
]
=
$className
;
...
...
@@ -167,12 +168,12 @@ abstract class Type
* @static
* @param string $name
* @param string $className
* @throws D
octrine
Exception
* @throws D
BAL
Exception
*/
public
static
function
overrideType
(
$name
,
$className
)
{
if
(
!
isset
(
self
::
$_typesMap
[
$name
]))
{
throw
D
octrine
Exception
::
typeNotFound
(
$name
);
throw
D
BAL
Exception
::
typeNotFound
(
$name
);
}
self
::
$_typesMap
[
$name
]
=
$className
;
...
...
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