Skip to content

Commit e453be6

Browse files
committed
Merge pull request #9 from mintbridge/adding-static-php-driver
adding the abilty to use static php mappings
2 parents b925a32 + d7c6a36 commit e453be6

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,13 +201,14 @@ Configuration
201201

202202
Each mapping definition should be an array with the following
203203
options:
204-
* **type**: Mapping driver type, one of `annotation`, `xml`, or `yml`.
204+
* **type**: Mapping driver type, one of `annotation`, `xml`, `yml` or `php`.
205205
* **namespace**: Namespace in which the entities reside.
206206

207207
Additionally, each mapping definition should contain one of the
208208
following options:
209209
* **path**: Path to where the mapping files are located. This should
210-
be an actual filesystem path.
210+
be an actual filesystem path. For the php driver it can be an array
211+
of paths
211212
* **resources_namespace**: A namespaceish path to where the mapping
212213
files are located. Example: `Path\To\Foo\Resources\mappings`
213214

src/Dflydev/Pimple/Provider/DoctrineOrm/DoctrineOrmServiceProvider.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
use Doctrine\ORM\Mapping\Driver\Driver;
2424
use Doctrine\ORM\Mapping\Driver\XmlDriver;
2525
use Doctrine\ORM\Mapping\Driver\YamlDriver;
26+
use Doctrine\ORM\Mapping\Driver\StaticPHPDriver;
2627

2728
/**
2829
* Doctrine ORM Pimple Service Provider.
@@ -136,6 +137,10 @@ public function register(\Pimple $app)
136137
$driver = new XmlDriver($entity['path']);
137138
$chain->addDriver($driver, $entity['namespace']);
138139
break;
140+
case 'php':
141+
$driver = new StaticPHPDriver($entity['path']);
142+
$chain->addDriver($driver, $entity['namespace']);
143+
break;
139144
default:
140145
throw new \InvalidArgumentException(sprintf('"%s" is not a recognized driver', $entity['type']));
141146
break;

0 commit comments

Comments
 (0)