Skip to content

Raise an error when one call \count($entity->getSomethingThatIsACollection() #629

Open
@lyrixx

Description

@lyrixx

It would be very nice to raise an error when one call

\count($entity->getSomethingThatIsACollection())

It's an error because doctrine will

  1. fetch all data from the DB
  2. hydrate everything
  3. and finally call count() on the results

=> It will kill the performance when the collection is big

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions