我有两个问题,一时我就一直在讨论。 我正在使用Doctrine 2.0来开展一些我正在从事的项目,我已经触及了一个大问题。
In most of the projects frontend applications I am hydrating to arrays rather than objects; by which I mean when I produce a doctrine query I might do this:
$entityManager = $this->getEntityManager();
$query = $entityManager->getQueryBuilder();
$query->select( something , somethingElse )
->from( MyEntityLocation , something )
->leftJoin( something.somethingelse , somethingElse )
->where( something.id = :someId )
->setParameter( someId , $someId)
->getQuery();
$result = $query->getArrayResult();
现在,这是我对我们申请前端的所有法典所做的事,因为对阵列的hydr力远比对物体的hydr。 现在我的问题是: 如果我使用斜线,我是否应该真正使用<条码>植被恢复(<>条码/代码”),然后通过实体回到那里来,与他们交流?
I use getResult
or getSingleResult
when I am say in the administration area and I am making a change to an entity; however it just feels a little odd using the incredibly heavy Doctrine just to retrieve information into an array on the frontend - something I could do with a simple PDO anyway?!?
我希望我提出的问题足够清楚。
纽约总部