[{"data":1,"prerenderedAt":183},["ShallowReactive",2],{"page-\u002Fv1\u002Fadapters\u002Fsymfony\u002Fpersistence":3},{"id":4,"title":5,"body":6,"description":175,"extension":176,"meta":177,"navigation":178,"path":179,"seo":180,"stem":181,"__hash__":182},"content\u002Fv1\u002Fadapters\u002Fsymfony\u002Fpersistence.md","Symfony persistence",{"type":7,"value":8,"toc":168},"minimark",[9,13,48,55,60,70,74,94,98,145,149],[10,11,5],"h1",{"id":12},"symfony-persistence",[14,15,16],"blockquote",{},[17,18,19,23,24,27,28,31,34,35,42,43],"p",{},[20,21,22],"strong",{},"Host:"," Symfony ",[20,25,26],{},"8.1.x"," (PHP ≥ 8.4) · Researched 2026-08",[29,30],"br",{},[20,32,33],{},"One-shot:"," ",[36,37,39],"a",{"href":38},"\u002Fapply\u002Fsymfony.full.md",[40,41,38],"code",{}," · Short: ",[36,44,46],{"href":45},"\u002Fsymfony",[40,47,45],{},[17,49,50,51,54],{},"Doctrine entities and repositories live in ",[20,52,53],{},"Infrastructure",". Domain Entities stay plain PHP.",[56,57,59],"h2",{"id":58},"layout","Layout",[61,62,68],"pre",{"className":63,"code":65,"language":66,"meta":67},[64],"language-text","{Module}\u002FInfrastructure\u002FPersistence\u002FDoctrine\u002F\n  Entity\u002F          # Doctrine-mapped models (not Domain Entities)\n  Repository\u002F      # implements Domain ports\n  Migrations\u002F      # or project migrations\u002F with module prefixes\n","text","",[40,69,65],{"__ignoreMap":67},[56,71,73],{"id":72},"rules","Rules",[75,76,77,85,88,91],"ul",{},[78,79,80,81,84],"li",{},"Never inject ",[40,82,83],{},"EntityManagerInterface"," into Use Cases or Domain.",[78,86,87],{},"Map Doctrine entity ↔ Domain Entity in the repository adapter.",[78,89,90],{},"DQL\u002FQueryBuilder stay inside Infra.",[78,92,93],{},"Prefer module-owned tables; avoid coupling schemas across BCs.",[56,95,97],{"id":96},"anti-patterns","Anti-patterns",[99,100,101,114],"table",{},[102,103,104],"thead",{},[105,106,107,111],"tr",{},[108,109,110],"th",{},"Smell",[108,112,113],{},"Fix",[115,116,117,126,137],"tbody",{},[105,118,119,123],{},[120,121,122],"td",{},"Doctrine entity used as Domain Entity",[120,124,125],{},"Separate Domain Entity + map",[105,127,128,134],{},[120,129,130,133],{},[40,131,132],{},"#[ORM\\…]"," on Domain classes",[120,135,136],{},"Move mapping to Infra model",[105,138,139,142],{},[120,140,141],{},"EM flushed inside Use Case",[120,143,144],{},"Port + Infra unit of work adapter",[56,146,148],{"id":147},"related","Related",[75,150,151,157],{},[78,152,153],{},[36,154,156],{"href":155},"\u002Fv1\u002Fadapters\u002Fsymfony","Symfony adapter overview",[78,158,159,163,164],{},[36,160,162],{"href":161},"\u002Fv1\u002Fcore","Core"," · ",[36,165,167],{"href":166},"\u002Fv1\u002Fadopt\u002Fapply","Apply index",{"title":67,"searchDepth":169,"depth":169,"links":170},2,[171,172,173,174],{"id":58,"depth":169,"text":59},{"id":72,"depth":169,"text":73},{"id":96,"depth":169,"text":97},{"id":147,"depth":169,"text":148},"Doctrine ORM stays in Infrastructure for Modular Hexagonal DDD.","md",{},true,"\u002Fv1\u002Fadapters\u002Fsymfony\u002Fpersistence",{"title":5,"description":175},"v1\u002Fadapters\u002Fsymfony\u002Fpersistence","tpLBxsRoKQWoZu5HpSovWsrJ4hRb5DSGjM-mA4DbXeA",1786241414157]