Skip to content

Dont work with MongoDB DocumentManager #182

@JDolezal

Description

@JDolezal

EntityToPropertyTransformer.php and EntitiesToPropertyTransformer.php are not compatible with MongoDB DocumentManager.

The following code in EntityToPropertyTransformer.php

$entity = $this->em->createQueryBuilder() ->select('entity') ->from($this->className, 'entity') ->where('entity.'.$this->primaryKey.' = :id') ->setParameter('id', $value) ->getQuery() ->getSingleResult();

has to be changed to

$entity = $this->em->getRepository($this->className)->find($value);

to get it working. Similar issue with EntitiesToPropertyTransformer.php

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions