8000 DoctrineDataCollector does not output objects in queries · Issue #20673 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content 8000
DoctrineDataCollector does not output objects in queries #20673
Closed
@garak

Description

@garak

The method sanitizeParam in DoctrineDataCollector is currently returning the name of the class for objects. It would be nice if it would return a string representation of that object, e.g. replacing sprintf('Object(%s)', get_class($var)) with (string) $var.

The following is my use case.
I'm using Ramsey Uuid ofr IDs in my entity. Two entities are in a OneToMany relation and I try to build a query via QueryBuilder, passing the owning side Entity to the Repository of the opposite side and doing $queryBuilder->where('oppositeEntity.owningEntity = :owning')->setParameter('owning', $owning), where $owning is an instance of Uuid.

What I expect in the profiler is a runnable query with the actual Uuid as string inside, so I can copy&paste it and run it inside my database. Instead, I'm getting 'Object(Ramsey\\Uuid\\Uuid)', that defeats the purpose of the query being runnable.

[Edit: I'm on Symfony 2.8.14 with Doctrine 2.5.5]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0