Load a record with

What is the preferred way to load a record using doctrine?

I'm using it

$em = EntityManager::create($connectionOptions,$config);
$dql = "select r from Rolle r";
$list = $em->createQuery($dql)->getResult();

Get record list

I tried it

$dql = Doctrine_Query::create()
    ->from('Rolle r') 
    ->where('r.ID = 14');
$rolle = $dql->fetchArray();

Get a record Is this the preferred way?

If yes: I received an internal server error: the class' Doctrine 'cannot be found online_ Query’…

I searched for a document containing the string 'Doctrine'_ Query 'file, but I don't have such a file So where can I find this course?

Solution

You can use getsingleresult () instead of getResult () This is the document in this chapter of the dogma document

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>