Skip to content

Commit cb63a69

Browse files
committed
Merge pull request #58 from ElectricMaxxx/manager-names
add possibility to fetch the managers by its names
2 parents 8fea01a + 7d87033 commit cb63a69

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Changelog
44
1.1.0-RC2
55
---------
66

7+
* **2014-06-11**: fetch manager by its name
78
* **2014-04-24**: [DEPRECATE] Deprecated the `sonata_admin` bundle set
89
* **2014-04-24**: added bundle sets: `sonata_admin_orm` and `sonata_admin_phpcr`
910
* **2014-04-11**: dropped Symfony 2.2 compatibility

src/Symfony/Cmf/Component/Testing/Functional/DbManager/ORM.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,13 @@ public function getRegistry()
5959
/**
6060
* Gets the Doctrine ObjectManager
6161
*
62+
* @param null $managerName
6263
* @return ObjectManager
6364
*/
64-
public function getOm()
65+
public function getOm($managerName = null)
6566
{
6667
if (!$this->om) {
67-
$this->om = $this->getRegistry()->getManager();
68+
$this->om = $this->getRegistry()->getManager($managerName);
6869
}
6970

7071
return $this->om;

src/Symfony/Cmf/Component/Testing/Functional/DbManager/PHPCR.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,14 @@ public function getRegistry()
3535
return $this->container->get('doctrine_phpcr');
3636
}
3737

38-
public function getOm()
38+
/**
39+
* @param null|string $managerName
40+
* @return DocumentManager
41+
*/
42+
public function getOm($managerName = null)
3943
{
4044
if (!$this->om) {
41-
$this->om = $this->getRegistry()->getManager();
45+
$this->om = $this->getRegistry()->getManager($managerName);
4246
}
4347

4448
return $this->om;

0 commit comments

Comments
 (0)