Doctrine 2 setParameter不能处理字符串

时间:2016-02-22 07:57:24

标签: orm doctrine-orm doctrine-query

$query = $em->createQuery('SELECT u FROM Entity\User u where u.first_name = :name');

$query->setParameter('name', 'Fawad');
$users = $query->getResult();

foreach ($users as $items) {
   echo $items->getId() . " " . $items->getFirstName() . "<br>";
}

0 个答案:

没有答案