Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 47 lines (41 sloc) 1.731 kB
e58b61f @lsmith77 added ManagerRegistry
lsmith77 authored
1 <?php
2
39d39c2 @lsmith77 use LGPL, since we are using LGPL code from other Doctrine bundles
lsmith77 authored
3 /*
4 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
5 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
6 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
7 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
10 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
11 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
12 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
13 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
14 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15 *
16 * This software consists of voluntary contributions made by many individuals
5df402c @dbu change DoctrinePHPCRBundle to MIT license. see Resources/meta/approva…
dbu authored
17 * and is licensed under the MIT license. For more information, see
39d39c2 @lsmith77 use LGPL, since we are using LGPL code from other Doctrine bundles
lsmith77 authored
18 * <http://www.doctrine-project.org>.
19 */
20
e3069e4 @lsmith77 updated namespace
lsmith77 authored
21 namespace Doctrine\Bundle\PHPCRBundle;
e58b61f @lsmith77 added ManagerRegistry
lsmith77 authored
22
23 use Symfony\Bridge\Doctrine\ManagerRegistry as BaseManagerRegistry;
24 use Doctrine\ODM\PHPCR\PHPCRException;
25
26 class ManagerRegistry extends BaseManagerRegistry
27 {
28 /**
29 * Resolves a registered namespace alias to the full namespace.
30 *
31 * @param string $alias
32 * @return string
33 * @throws PHPCRException
34 */
35 public function getAliasNamespace($alias)
36 {
37 foreach (array_keys($this->getManagers()) as $name) {
38 try {
39 return $this->getManager($name)->getConfiguration()->getDocumentNamespace($alias);
40 } catch (PHPCRException $e) {
41 }
42 }
43
e562d18 @lsmith77 typo fix
lsmith77 authored
44 throw PHPCRException::unknownDocumentNamespace($alias);
e58b61f @lsmith77 added ManagerRegistry
lsmith77 authored
45 }
46 }
Something went wrong with that request. Please try again.