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
93b2cb0a
Commit
93b2cb0a
authored
Sep 12, 2008
by
romanb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moved entity/entitymanager exceptions
parent
e69034fc
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
5 additions
and
130 deletions
+5
-130
Entity.php
lib/Doctrine/Entity.php
+1
-1
Exception.php
lib/Doctrine/Entity/Exception.php
+0
-65
EntityManager.php
lib/Doctrine/EntityManager.php
+1
-1
Exception.php
lib/Doctrine/EntityManager/Exception.php
+0
-60
AccessTest.php
tests/Orm/Component/AccessTest.php
+2
-2
EntityManagerTest.php
tests/Orm/EntityManagerTest.php
+1
-1
No files found.
lib/Doctrine/Entity.php
View file @
93b2cb0a
...
@@ -453,7 +453,7 @@ abstract class Doctrine_Entity implements ArrayAccess, Serializable
...
@@ -453,7 +453,7 @@ abstract class Doctrine_Entity implements ArrayAccess, Serializable
}
}
}
}
}
else
{
}
else
{
throw
Doctrine_
Entity_
Exception
::
invalidField
(
$fieldName
);
throw
Doctrine_
ORM_Exceptions_Entity
Exception
::
invalidField
(
$fieldName
);
}
}
}
}
...
...
lib/Doctrine/Entity/Exception.php
deleted
100644 → 0
View file @
e69034fc
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
#namespace Doctrine::ORM;
/**
* Doctrine_Entity_Exception
*
* @package Doctrine
* @subpackage Entity
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Roman Borschel <roman@code-factory.org>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.org
* @since 2.0
* @version $Revision$
*/
class
Doctrine_Entity_Exception
extends
Doctrine_Exception
{
public
static
function
unknownField
(
$field
)
{
return
new
self
(
"Undefined field: '
$field
'."
);
}
public
static
function
invalidValueForOneToManyReference
()
{
return
new
self
(
"Invalid value. The value of a reference in a OneToMany "
.
"association must be a Collection."
);
}
public
static
function
invalidValueForOneToOneReference
()
{
return
new
self
(
"Invalid value. The value of a reference in a OneToOne "
.
"association must be an Entity."
);
}
public
static
function
invalidValueForManyToManyReference
()
{
return
new
self
(
"Invalid value. The value of a reference in a ManyToMany "
.
"association must be a Collection."
);
}
public
static
function
invalidField
(
$field
)
{
return
new
self
(
"Invalid field: '
$field
'."
);
}
}
\ No newline at end of file
lib/Doctrine/EntityManager.php
View file @
93b2cb0a
...
@@ -350,7 +350,7 @@ class Doctrine_EntityManager
...
@@ -350,7 +350,7 @@ class Doctrine_EntityManager
public
function
setFlushMode
(
$flushMode
)
public
function
setFlushMode
(
$flushMode
)
{
{
if
(
!
$this
->
_isFlushMode
(
$flushMode
))
{
if
(
!
$this
->
_isFlushMode
(
$flushMode
))
{
throw
Doctrine_
EntityManager_
Exception
::
invalidFlushMode
();
throw
Doctrine_
ORM_Exceptions_EntityManager
Exception
::
invalidFlushMode
();
}
}
$this
->
_flushMode
=
$flushMode
;
$this
->
_flushMode
=
$flushMode
;
}
}
...
...
lib/Doctrine/EntityManager/Exception.php
deleted
100644 → 0
View file @
e69034fc
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
#namespace Doctrine::ORM::Exceptions;
/**
* Doctrine_EntityManager_Exception
*
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Roman Borschel <roman@code-factory.org>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.org
* @since 2.0
* @version $Revision$
*/
class
Doctrine_EntityManager_Exception
extends
Doctrine_Exception
{
public
static
function
invalidFlushMode
()
{
return
new
self
(
"Invalid flush mode."
);
}
public
static
function
noEntityManagerAvailable
()
{
return
new
self
(
"No EntityManager available."
);
}
public
static
function
entityAlreadyBound
(
$entityName
)
{
return
new
self
(
"The entity '
$entityName
' is already bound."
);
}
public
static
function
noManagerWithName
(
$emName
)
{
return
new
self
(
"EntityManager named '
$emName
' not found."
);
}
public
static
function
unknownAttribute
(
$name
)
{
return
new
self
(
"Unknown EntityManager attribute '
$name
'."
);
}
}
\ No newline at end of file
tests/Orm/Component/AccessTest.php
View file @
93b2cb0a
...
@@ -96,7 +96,7 @@ class Orm_Component_AccessTest extends Doctrine_OrmTestCase
...
@@ -96,7 +96,7 @@ class Orm_Component_AccessTest extends Doctrine_OrmTestCase
/**
/**
* @test
* @test
* @expectedException Doctrine_
Entity_
Exception
* @expectedException Doctrine_
ORM_Exceptions_Entity
Exception
*/
*/
public
function
shouldNotBeAbleToSetNonExistantField
()
public
function
shouldNotBeAbleToSetNonExistantField
()
{
{
...
@@ -105,7 +105,7 @@ class Orm_Component_AccessTest extends Doctrine_OrmTestCase
...
@@ -105,7 +105,7 @@ class Orm_Component_AccessTest extends Doctrine_OrmTestCase
/**
/**
* @test
* @test
* @expectedException Doctrine_
Entity_
Exception
* @expectedException Doctrine_
ORM_Exceptions_Entity
Exception
*/
*/
public
function
shouldNotBeAbleToSetNonExistantFieldWithOffset
()
public
function
shouldNotBeAbleToSetNonExistantFieldWithOffset
()
{
{
...
...
tests/Orm/EntityManagerTest.php
View file @
93b2cb0a
...
@@ -14,7 +14,7 @@ class Orm_EntityManagerTest extends Doctrine_OrmTestCase
...
@@ -14,7 +14,7 @@ class Orm_EntityManagerTest extends Doctrine_OrmTestCase
try
{
try
{
$this
->
_em
->
setFlushMode
(
'foobar'
);
$this
->
_em
->
setFlushMode
(
'foobar'
);
$this
->
fail
(
"Setting invalid flushmode did not trigger exception."
);
$this
->
fail
(
"Setting invalid flushmode did not trigger exception."
);
}
catch
(
Doctrine_
EntityManager_
Exception
$expected
)
{}
}
catch
(
Doctrine_
ORM_Exceptions_EntityManager
Exception
$expected
)
{}
$this
->
_em
->
setFlushMode
(
$prev
);
$this
->
_em
->
setFlushMode
(
$prev
);
}
}
}
}
\ No newline at end of file
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