Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8054a66

Browse files
committed
Prepare renaming
1 parent 8a6e8e3 commit 8054a66

12 files changed

Lines changed: 44 additions & 44 deletions

DependencyInjection/Configuration.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace hacfi\Bundle\DoctrineBridgeBundle\DependencyInjection;
3+
namespace Hacfi\Bundle\ObjectBridgeBundle\DependencyInjection;
44

55
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
66
use Symfony\Component\Config\Definition\ConfigurationInterface;
@@ -13,7 +13,7 @@ class Configuration implements ConfigurationInterface
1313
public function getConfigTreeBuilder()
1414
{
1515
$treeBuilder = new TreeBuilder();
16-
$rootNode = $treeBuilder->root('hacfi_doctrine_bridge');
16+
$rootNode = $treeBuilder->root('hacfi_object_bridge');
1717

1818
return $treeBuilder;
1919
}

DependencyInjection/hacfiDoctrineBridgeExtension.php renamed to DependencyInjection/HacfiObjectBridgeExtension.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?php
22

3-
namespace hacfi\Bundle\DoctrineBridgeBundle\DependencyInjection;
3+
namespace Hacfi\Bundle\ObjectBridgeBundle\DependencyInjection;
44

55
use Symfony\Component\DependencyInjection\ContainerBuilder;
66
use Symfony\Component\Config\FileLocator;
77
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
88
use Symfony\Component\DependencyInjection\Loader;
99

10-
class hacfiDoctrineBridgeExtension extends Extension
10+
class HacfiObjectBridgeExtension extends Extension
1111
{
1212
/**
1313
* {@inheritDoc}
@@ -17,7 +17,7 @@ public function load(array $configs, ContainerBuilder $container)
1717
$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
1818
$loader->load('services.xml');
1919

20-
$cacheDirectoryUnresolved = $container->getParameterBag()->get('doctrine_bridge.cache_dir');
20+
$cacheDirectoryUnresolved = $container->getParameterBag()->get('object_bridge.cache_dir');
2121
$cacheDirectory = $container->getParameterBag()->resolveValue($cacheDirectoryUnresolved);
2222
if (!is_dir($cacheDirectory)) {
2323
mkdir($cacheDirectory, 0777, true);

EventListener/DoctrineORMEventSubscriber.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?php
22

3-
namespace hacfi\Bundle\DoctrineBridgeBundle\EventListener;
3+
namespace Hacfi\Bundle\ObjectBridgeBundle\EventListener;
44

55
use Doctrine\Common\EventSubscriber;
66
use Doctrine\ORM\Event\LifecycleEventArgs;
77
use Doctrine\Common\Util\ClassUtils;
88

9-
use hacfi\Bundle\DoctrineBridgeBundle\Mapping\Driver\AnnotationDriver;
9+
use Hacfi\Bundle\ObjectBridgeBundle\Mapping\Driver\AnnotationDriver;
1010

1111
class DoctrineORMEventSubscriber implements EventSubscriber
1212
{

EventListener/DoctrinePHPCREventSubscriber.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?php
22

3-
namespace hacfi\Bundle\DoctrineBridgeBundle\EventListener;
3+
namespace Hacfi\Bundle\ObjectBridgeBundle\EventListener;
44

55
use Doctrine\Common\EventSubscriber;
66
//use Doctrine\ODM\PHPCR\Event\LifecycleEventArgs;
77
use Doctrine\Common\Persistence\Event\LifecycleEventArgs;
88
use Doctrine\Common\Util\ClassUtils;
99

10-
use hacfi\Bundle\DoctrineBridgeBundle\Mapping\Driver\AnnotationDriver;
10+
use Hacfi\Bundle\ObjectBridgeBundle\Mapping\Driver\AnnotationDriver;
1111

1212
class DoctrinePHPCREventSubscriber implements EventSubscriber
1313
{

HacfiObjectBridgeBundle.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
namespace Hacfi\Bundle\ObjectBridgeBundle;
4+
5+
use Symfony\Component\HttpKernel\Bundle\Bundle;
6+
7+
class HacfiObjectBridgeBundle extends Bundle
8+
{
9+
}

Mapping/Driver/AnnotationDriver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace hacfi\Bundle\DoctrineBridgeBundle\Mapping\Driver;
3+
namespace Hacfi\Bundle\ObjectBridgeBundle\Mapping\Driver;
44

55
use Doctrine\Common\Annotations\AnnotationReader;
66
use Doctrine\Common\Cache\Cache;
@@ -41,7 +41,7 @@ public function loadMetadataForClass($className)
4141
$bridges = array();
4242

4343
foreach ($class->getProperties() as $property) {
44-
if (null !== $bridge = $this->reader->getPropertyAnnotation($property, 'hacfi\Bundle\DoctrineBridgeBundle\Mapping\DoctrineBridge\Reference')) {
44+
if (null !== $bridge = $this->reader->getPropertyAnnotation($property, 'Hacfi\Bundle\ObjectBridgeBundle\Mapping\ObjectBridge\Reference')) {
4545
// @TODO: Validate type here?
4646
4747
$bridges[$property->getName()] = array(
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<?php
22

3-
require_once __DIR__.'/../DoctrineBridge/Reference.php';
3+
require_once __DIR__.'/../ObjectBridge/Reference.php';
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace hacfi\Bundle\DoctrineBridgeBundle\Mapping\DoctrineBridge;
3+
namespace Hacfi\Bundle\ObjectBridgeBundle\Mapping\ObjectBridge;
44

55
use Doctrine\Common\Annotations\Annotation;
66

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
hacfi Doctrine Bridge Bundle
1+
hacfi Object Bridge Bundle
22
===
33

44
This bundle allows associations between different Doctrine ORMs and ODMs.
@@ -20,7 +20,7 @@ TODO:
2020
- [ ] Create a registry for Doctrine mappers to make it extendable (MongoDB ODM & CouchDB ODM)
2121
- [ ] Validate the mappings and make sure the mapper specified via ```type``` is available
2222

23-
Please note that the use-statement for the annotations has to be "use hacfi\Bundle\DoctrineBridgeBundle\Mapping\DoctrineBridge;"
23+
Please note that the use-statement for the annotations has to be "use Hacfi\Bundle\ObjectBridgeBundle\Mapping\ObjectBridge;"
2424
and doesn’t allow aliasing because the Doctrine’s SimpleAnnotationReader doesn’t support it. This might change in the future.
2525

2626

@@ -30,28 +30,28 @@ Install
3030
app/AppKernel.php:
3131

3232
```php
33-
new hacfi\Bundle\DoctrineBridgeBundle\hacfiDoctrineBridgeBundle(),
33+
new Doctrine\Bundle\DoctrineObjectBridgeBundle\DoctrineObjectBridgeBundle(),
3434
```
3535

3636
app/autoload.php:
3737

3838
```php
39-
AnnotationRegistry::registerFile(__DIR__.'/../vendor/hacfi/doctrine-bridge-bundle/hacfi/Bundle/DoctrineBridgeBundle/Mapping/DoctrineBridge/Reference.php');
39+
AnnotationRegistry::registerFile(__DIR__.'/../vendor/hacfi/object-bridge-bundle/Hacfi/Bundle/ObjectBridgeBundle/Mapping/ObjectBridge/Reference.php');
4040
```
4141

4242
Example
4343
---
4444

45-
/src/hacfi/AppBundle/Entity/Product.php:
45+
/src/Hacfi/AppBundle/Entity/Product.php:
4646

4747
```php
4848
<?php
49-
namespace hacfi\AppBundle\Entity;
49+
namespace Hacfi\AppBundle\Entity;
5050

51-
use hacfi\AppBundle\Document\ProductProperties;
51+
use Hacfi\AppBundle\Document\ProductProperties;
5252

5353
use Doctrine\ORM\Mapping as ORM;
54-
use hacfi\Bundle\DoctrineBridgeBundle\Mapping\DoctrineBridge;
54+
use Hacfi\Bundle\ObjectBridgeBundle\Mapping\ObjectBridge;
5555

5656
/**
5757
* Product
@@ -76,24 +76,24 @@ class Product implements ProductInterface
7676
/**
7777
* @ORM\Column(name="properties", type="string", length=255, nullable=false)
7878
*
79-
* @DoctrineBridge\Reference(type="phpcr", name="hacfiAppBundle:ProductProperties", manager="default")
79+
* @ObjectBridge\Reference(type="phpcr", name="HacfiAppBundle:ProductProperties", manager="default")
8080
*/
8181
private $properties;
8282

8383
}
8484

8585
```
8686

87-
/src/hacfi/AppBundle/Document/ProductProperties.php:
87+
/src/Hacfi/AppBundle/Document/ProductProperties.php:
8888

8989
```php
9090
<?php
91-
namespace hacfi\AppBundle\Document;
91+
namespace Hacfi\AppBundle\Document;
9292

93-
use hacfi\AppBundle\Entity\Product;
93+
use Hacfi\AppBundle\Entity\Product;
9494

9595
use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCRODM;
96-
use hacfi\Bundle\DoctrineBridgeBundle\Mapping\DoctrineBridge;
96+
use Hacfi\Bundle\ObjectBridgeBundle\Mapping\ObjectBridge;
9797

9898
/**
9999
* ProductProperties
@@ -111,7 +111,7 @@ class ProductProperties
111111
/**
112112
* @PHPCRODM\String
113113
*
114-
* @DoctrineBridge\Reference(type="orm", name="hacfiAppBundle:Product", manager="default")
114+
* @ObjectBridge\Reference(type="orm", name="HacfiAppBundle:Product", manager="default")
115115
*/
116116
protected $product;
117117

Resources/config/services.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
<parameter key="doctrine_bridge.simple_annotation_reader.class">Doctrine\Common\Annotations\SimpleAnnotationReader</parameter>
1010
<parameter key="doctrine_bridge.annotation_cache.class">Doctrine\Common\Cache\PhpFileCache</parameter>
1111
<parameter key="doctrine_bridge.cached_annotation_reader.class">Doctrine\Common\Annotations\CachedReader</parameter>
12-
<parameter key="doctrine_bridge.metadata.provider.class">hacfi\Bundle\DoctrineBridgeBundle\Mapping\Driver\AnnotationDriver</parameter>
13-
<parameter key="doctrine_bridge.orm.event_subscriber.class">hacfi\Bundle\DoctrineBridgeBundle\EventListener\DoctrineORMEventSubscriber</parameter>
14-
<parameter key="doctrine_bridge.phpcr.event_subscriber.class">hacfi\Bundle\DoctrineBridgeBundle\EventListener\DoctrinePHPCREventSubscriber</parameter>
12+
<parameter key="doctrine_bridge.metadata.provider.class">Hacfi\Bundle\ObjectBridgeBundle\Mapping\Driver\AnnotationDriver</parameter>
13+
<parameter key="doctrine_bridge.orm.event_subscriber.class">Hacfi\Bundle\ObjectBridgeBundle\EventListener\DoctrineORMEventSubscriber</parameter>
14+
<parameter key="doctrine_bridge.phpcr.event_subscriber.class">Hacfi\Bundle\ObjectBridgeBundle\EventListener\DoctrinePHPCREventSubscriber</parameter>
1515
</parameters>
1616

1717
<services>
1818
<service id="doctrine_bridge.annotation_reader" class="%doctrine_bridge.simple_annotation_reader.class%" public="false">
1919
<call method="addNamespace">
20-
<argument>hacfi\Bundle\DoctrineBridgeBundle\Mapping</argument>
20+
<argument>Hacfi\Bundle\ObjectBridgeBundle\Mapping</argument>
2121
</call>
2222
</service>
2323

0 commit comments

Comments
 (0)