Skip to content

Commit

Permalink
Make getObjectManager protected
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet committed May 29, 2022
1 parent 120d25e commit 0dd24ae
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions src/Model/BaseManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,26 +34,6 @@ public function __construct(
) {
}

/**
* @throws \RuntimeException
*/
public function getObjectManager(): ObjectManager
{
$manager = $this->registry->getManagerForClass($this->class);

if (null === $manager) {
throw new \RuntimeException(sprintf(
'Unable to find the mapping information for the class %s.'
.' Please check the `auto_mapping` option'
.' (http://symfony.com/doc/current/reference/configuration/doctrine.html#configuration-overview)'
.' or add the bundle to the `mappings` section in the doctrine configuration.',
$this->class
));
}

return $manager;
}

public function getClass(): string
{
return $this->class;
Expand Down Expand Up @@ -138,4 +118,24 @@ protected function checkObject(object $object): void
));
}
}

/**
* @throws \RuntimeException
*/
protected function getObjectManager(): ObjectManager
{
$manager = $this->registry->getManagerForClass($this->class);

if (null === $manager) {
throw new \RuntimeException(sprintf(
'Unable to find the mapping information for the class %s.'
.' Please check the `auto_mapping` option'
.' (http://symfony.com/doc/current/reference/configuration/doctrine.html#configuration-overview)'
.' or add the bundle to the `mappings` section in the doctrine configuration.',
$this->class
));
}

return $manager;
}
}

0 comments on commit 0dd24ae

Please sign in to comment.