【发布时间】:2016-01-20 12:19:47
【问题描述】:
这段代码运行良好:
class AlbumController extends AbstractActionController
{
public function indexAction()
{
return new ViewModel(
array(
'albums' => $this->getEntityManager()->getRepository('Album\Entity\Album')->findAll()
)
);
}
}
此代码发送了空对象:
class AlbumController extends AbstractRestfulController
{
public function getList()
{
return new JsonModel(
array(
'albums' => $this->getEntityManager()->getRepository('Album\Entity\Album')->findAll()
)
);
}
}
//is returning result like this
{"albums":[{},{},{},{},{},{},{},{}]}
【问题讨论】:
标签: php orm doctrine-orm zend-framework2