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
32d43c36
Commit
32d43c36
authored
Feb 17, 2009
by
romanb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed 'name' attribute from EntityManager since it's not needed.
parent
2ef81cf2
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
38 deletions
+11
-38
EntityManager.php
lib/Doctrine/ORM/EntityManager.php
+4
-26
EntityManagerMock.php
tests/Doctrine/Tests/Mocks/EntityManagerMock.php
+3
-3
EntityPersisterTest.php
tests/Doctrine/Tests/ORM/EntityPersisterTest.php
+1
-6
UnitOfWorkTest.php
tests/Doctrine/Tests/ORM/UnitOfWorkTest.php
+1
-1
OrmFunctionalTestCase.php
tests/Doctrine/Tests/OrmFunctionalTestCase.php
+1
-1
OrmTestCase.php
tests/Doctrine/Tests/OrmTestCase.php
+1
-1
No files found.
lib/Doctrine/ORM/EntityManager.php
View file @
32d43c36
...
...
@@ -59,13 +59,6 @@ class EntityManager
*/
const
FLUSHMODE_MANUAL
=
'manual'
;
/**
* The unique name of the EntityManager.
*
* @var string
*/
private
$_name
;
/**
* The used Configuration.
*
...
...
@@ -143,10 +136,9 @@ class EntityManager
* @param Doctrine\ORM\Configuration $config
* @param Doctrine\Common\EventManager $eventManager
*/
protected
function
__construct
(
Connection
$conn
,
$name
,
Configuration
$config
,
EventManager
$eventManager
)
protected
function
__construct
(
Connection
$conn
,
Configuration
$config
,
EventManager
$eventManager
)
{
$this
->
_conn
=
$conn
;
$this
->
_name
=
$name
;
$this
->
_config
=
$config
;
$this
->
_eventManager
=
$eventManager
;
$this
->
_metadataFactory
=
new
ClassMetadataFactory
(
...
...
@@ -176,16 +168,6 @@ class EntityManager
return
$this
->
_metadataFactory
;
}
/**
* Gets the name of the EntityManager.
*
* @return string The name of the EntityManager.
*/
public
function
getName
()
{
return
$this
->
_name
;
}
/**
* Starts a transaction on the underlying connection.
*/
...
...
@@ -540,7 +522,7 @@ class EntityManager
private
function
_errorIfClosed
()
{
if
(
$this
->
_closed
)
{
throw
EntityManagerException
::
notActiveOrClosed
(
$this
->
_name
);
throw
EntityManagerException
::
notActiveOrClosed
();
}
}
...
...
@@ -602,9 +584,6 @@ class EntityManager
/**
* Factory method to create EntityManager instances.
*
* A newly created EntityManager is immediately activated, making it the
* currently active EntityManager.
*
* @param mixed $conn An array with the connection parameters or an existing
* Connection instance.
* @param string $name The name of the EntityManager.
...
...
@@ -612,8 +591,7 @@ class EntityManager
* @param EventManager $eventManager The EventManager instance to use.
* @return EntityManager The created EntityManager.
*/
public
static
function
create
(
$conn
,
$name
,
Configuration
$config
=
null
,
EventManager
$eventManager
=
null
)
public
static
function
create
(
$conn
,
Configuration
$config
=
null
,
EventManager
$eventManager
=
null
)
{
if
(
is_array
(
$conn
))
{
$conn
=
\Doctrine\DBAL\DriverManager
::
getConnection
(
$conn
,
$config
,
$eventManager
);
...
...
@@ -628,7 +606,7 @@ class EntityManager
$eventManager
=
new
EventManager
();
}
$em
=
new
EntityManager
(
$conn
,
$
name
,
$
config
,
$eventManager
);
$em
=
new
EntityManager
(
$conn
,
$config
,
$eventManager
);
return
$em
;
}
...
...
tests/Doctrine/Tests/Mocks/EntityManagerMock.php
View file @
32d43c36
...
...
@@ -58,8 +58,8 @@ class EntityManagerMock extends \Doctrine\ORM\EntityManager
* @param Doctrine_EventManager $eventManager
* @return Doctrine\ORM\EntityManager
*/
public
static
function
create
(
$conn
,
$name
,
\Doctrine\ORM\Configuration
$config
=
null
,
Doctrine_Common_
EventManager
$eventManager
=
null
)
public
static
function
create
(
$conn
,
\Doctrine\ORM\Configuration
$config
=
null
,
\Doctrine\Common\
EventManager
$eventManager
=
null
)
{
if
(
is_null
(
$config
))
{
$config
=
new
\Doctrine\ORM\Configuration
();
...
...
@@ -68,7 +68,7 @@ class EntityManagerMock extends \Doctrine\ORM\EntityManager
$eventManager
=
new
\Doctrine\Common\EventManager
();
}
return
new
EntityManagerMock
(
$conn
,
$
name
,
$
config
,
$eventManager
);
return
new
EntityManagerMock
(
$conn
,
$config
,
$eventManager
);
}
public
function
setIdGenerator
(
$className
,
$generator
)
...
...
tests/Doctrine/Tests/ORM/EntityPersisterTest.php
View file @
32d43c36
...
...
@@ -12,11 +12,6 @@ use Doctrine\Tests\Models\Forum\ForumAvatar;
require_once
__DIR__
.
'/../TestInit.php'
;
#require_once 'lib/mocks/Doctrine_EntityManagerMock.php';
#require_once 'lib/mocks/Doctrine_ConnectionMock.php';
#require_once 'lib/mocks/Doctrine_ClassMetadataMock.php';
#require_once 'lib/mocks/Doctrine_UnitOfWorkMock.php';
/**
* EntityPersister tests.
*/
...
...
@@ -30,7 +25,7 @@ class EntityPersisterTest extends \Doctrine\Tests\OrmTestCase
protected
function
setUp
()
{
parent
::
setUp
();
$this
->
_connMock
=
new
ConnectionMock
(
array
());
$this
->
_emMock
=
EntityManagerMock
::
create
(
$this
->
_connMock
,
'persisterMockEM'
);
$this
->
_emMock
=
EntityManagerMock
::
create
(
$this
->
_connMock
);
$this
->
_uowMock
=
new
UnitOfWorkMock
(
$this
->
_emMock
);
$this
->
_emMock
->
setUnitOfWork
(
$this
->
_uowMock
);
$this
->
_idGenMock
=
new
SequenceMock
(
$this
->
_emMock
);
...
...
tests/Doctrine/Tests/ORM/UnitOfWorkTest.php
View file @
32d43c36
...
...
@@ -28,7 +28,7 @@ class UnitOfWorkTest extends \Doctrine\Tests\OrmTestCase
protected
function
setUp
()
{
parent
::
setUp
();
$this
->
_connectionMock
=
new
ConnectionMock
(
array
());
$this
->
_emMock
=
EntityManagerMock
::
create
(
$this
->
_connectionMock
,
"uowMockEm"
);
$this
->
_emMock
=
EntityManagerMock
::
create
(
$this
->
_connectionMock
);
// SUT
$this
->
_unitOfWork
=
new
UnitOfWorkMock
(
$this
->
_emMock
);
$this
->
_emMock
->
setUnitOfWork
(
$this
->
_unitOfWork
);
...
...
tests/Doctrine/Tests/OrmFunctionalTestCase.php
View file @
32d43c36
...
...
@@ -135,6 +135,6 @@ class OrmFunctionalTestCase extends OrmTestCase
$config
->
setMetadataCacheImpl
(
self
::
$_metadataCacheImpl
);
$eventManager
=
new
\Doctrine\Common\EventManager
();
$conn
=
$this
->
sharedFixture
[
'conn'
];
return
\Doctrine\ORM\EntityManager
::
create
(
$conn
,
'em'
,
$config
,
$eventManager
);
return
\Doctrine\ORM\EntityManager
::
create
(
$conn
,
$config
,
$eventManager
);
}
}
\ No newline at end of file
tests/Doctrine/Tests/OrmTestCase.php
View file @
32d43c36
...
...
@@ -26,7 +26,7 @@ class OrmTestCase extends DoctrineTestCase
'user'
=>
'john'
,
'password'
=>
'wayne'
);
return
\Doctrine\ORM\EntityManager
::
create
(
$connectionOptions
,
'mockEM'
,
$config
,
$eventManager
);
return
\Doctrine\ORM\EntityManager
::
create
(
$connectionOptions
,
$config
,
$eventManager
);
}
private
static
function
getSharedMetadataCacheImpl
()
...
...
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