Skip to content

Latest commit

 

History

History
10 lines (6 loc) · 460 Bytes

File metadata and controls

10 lines (6 loc) · 460 Bytes

Do not introduce complex logic to $entity->get*EntityIdentifier* (performanceissue)

Problem:

  • Accessing ID of Doctrine Proxies is free operation, except when the body of getId method is non-trivial
  • See \Doctrine\Common\Proxy\ProxyGenerator::isShortIdentifierGetter

Solutions:

  • Do not add logic to entity getId() (or another method name, depending on the identifier), keep just simple return statement (src/ComplexEntityIdentifier/Solution)