Skip to content

Commit a68017f

Browse files
committed
Add a way to specify a naming strategy
1 parent 337b82d commit a68017f

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
language: php
22

33
php:
4-
- 5.5
54
- 5.6
65
- 7.0
76
- 7.1

src/FluentDriver.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Doctrine\Common\Persistence\Mapping\Driver\MappingDriver;
77
use Doctrine\ORM\Mapping\Builder\ClassMetadataBuilder;
88
use Doctrine\ORM\Mapping\MappingException;
9+
use Doctrine\ORM\Mapping\NamingStrategy;
910
use InvalidArgumentException;
1011
use LaravelDoctrine\Fluent\Builders\Builder;
1112
use LaravelDoctrine\Fluent\Mappers\MapperSet;
@@ -27,11 +28,14 @@ class FluentDriver implements MappingDriver
2728
* documents and operates in the specified operating mode.
2829
*
2930
* @param string[] $mappings
31+
* @param NamingStrategy $namingStrategy
3032
*/
31-
public function __construct(array $mappings = [])
32-
{
33-
$this->fluentFactory = function (ClassMetadata $metadata) {
34-
return new Builder(new ClassMetadataBuilder($metadata));
33+
public function __construct(
34+
array $mappings = [],
35+
NamingStrategy $namingStrategy = null
36+
) {
37+
$this->fluentFactory = function (ClassMetadata $metadata) use ($namingStrategy) {
38+
return new Builder(new ClassMetadataBuilder($metadata), $namingStrategy);
3539
};
3640

3741
$this->mappers = new MapperSet();

0 commit comments

Comments
 (0)