Skip to content

Commit 45fd318

Browse files
author
Petar Obradović
committed
Fix search scope when performing fallback mapping driver detection
1 parent d255388 commit 45fd318

File tree

2 files changed

+41
-2
lines changed

2 files changed

+41
-2
lines changed

DependencyInjection/AbstractDoctrineExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,8 @@ protected function detectMetadataDriver(string $dir, ContainerBuilder $container
279279
}
280280
$container->fileExists($resource, false);
281281

282-
if ($container->fileExists($dir.'/'.$this->getMappingObjectDefaultName(), false)) {
283-
return $this->detectMappingType($dir, $container);
282+
if ($container->fileExists($discoveryPath = $dir.'/'.$this->getMappingObjectDefaultName(), false)) {
283+
return $this->detectMappingType($discoveryPath, $container);
284284
}
285285

286286
return null;
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Fixtures\Bundles\AttributesBundle\AnnotatedEntity;
13+
14+
use Doctrine\ORM\Mapping\Column;
15+
use Doctrine\ORM\Mapping\Entity;
16+
use Doctrine\ORM\Mapping\Id;
17+
18+
/**
19+
* @Entity
20+
*/
21+
class Person
22+
{
23+
/** @Id @Column(type="integer") */
24+
protected $id;
25+
26+
/** @Column(type="string") */
27+
public $name;
28+
29+
public function __construct($id, $name)
30+
{
31+
$this->id = $id;
32+
$this->name = $name;
33+
}
34+
35+
public function __toString(): string
36+
{
37+
return (string) $this->name;
38+
}
39+
}

0 commit comments

Comments
 (0)