Skip to content

Commit

Permalink
ORM Installation check (#115)
Browse files Browse the repository at this point in the history
* do not assume ORM existence for token class and object manager
  • Loading branch information
juliangut authored and markitosgv committed Sep 19, 2018
1 parent 3071923 commit 4a2eab6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion DependencyInjection/GesdinetJWTRefreshTokenExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ public function load(array $configs, ContainerBuilder $container)
$refreshTokenClass = 'Gesdinet\JWTRefreshTokenBundle\Entity\RefreshToken';
$objectManager = 'doctrine.orm.entity_manager';

if ('mongodb' === strtolower($config['manager_type'])) {
if (!class_exists('Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass')
|| 'mongodb' === strtolower($config['manager_type'])
) {
$refreshTokenClass = 'Gesdinet\JWTRefreshTokenBundle\Document\RefreshToken';
$objectManager = 'doctrine_mongodb.odm.document_manager';
}
Expand Down

0 comments on commit 4a2eab6

Please sign in to comment.