【发布时间】:2016-12-06 04:45:42
【问题描述】:
所以我使用的是 Slim Framework 和 Doctrine,虽然我想在成功插入新数据时返回一个 json 响应,但一切正常。我的代码是:
$now = new \DateTime('now');
$people->setCreatedOn($now);
$people->setModifiedOn($now);
$people->setCreatedBy($this->engine->getCurrentUser()->getUserId());
$people->setModifiedBy($this->engine->getCurrentUser()->getUserId());
$this->em->persist($people);
$this->em->flush($people);
$person = $this->em->getRepository('App\Entities\EibPerson')->findOneBy(array('personId' => $people->getPersonId()));
return $response->withJSON($person->getArrayCopy());
虽然我没有看到任何响应 json,但数据已成功插入。我在这里做错了吗?
【问题讨论】:
标签: php json symfony doctrine-orm doctrine