Skip to content

Commit fc9cc08

Browse files
committed
Service locator ignores interface and other namings when locating entity
1 parent fc89dcd commit fc9cc08

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/Model/ServiceLocator.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ public function locateByEntityClass(
3838
): \Spameri\Elastic\Model\ServiceInterface
3939
{
4040
$serviceName = \str_replace('Entity', 'Model', $entityClass . 'Service');
41+
$serviceName = \str_replace('Interface', '', $serviceName);
42+
$serviceName = \str_replace('Abstract', '', $serviceName);
43+
$serviceName = \str_replace('Trait', '', $serviceName);
4144

4245
/** @var \Spameri\Elastic\Model\ServiceInterface $service */
4346
$service = $this->container->getByType($serviceName);

0 commit comments

Comments
 (0)