Symfony createView导致错误

时间:2017-12-11 11:58:33

标签: forms symfony

我正在使用Symfony 3.3.10

我有以下代码

 /**
     * @Route("/meta/edit/{metaId}", name="edit_price_meta_data")
     */
    public function editMetaAction(Request $request,ItemPriceMeta $metaId)
    {
        $metaDataForm = $this->createForm("ItemBundle\Form\ItemPriceMetaType");

        $data = [
            'metaData'=>$metaId,
            'metaDataForm'=>$metaDataForm->createView(),
        ];
        return $this->render("@Item/Prices/Manage/editMetaData.html.twig",$data);
    }

它会产生以下错误。

Error: Maximum execution time of 60 seconds exceeded

in vendor\doctrine\orm\lib\Doctrine\ORM\UnitOfWork.php (line 2513)

public function createEntity($className, array $data, &$hints = array()){
        $class = $this->em->getClassMetadata($className);
        //$isReadOnly = isset($hints[Query::HINT_READ_ONLY])

        $id = $this->identifierFlattener->flattenIdentifier($class, $data); 

        $idHash = implode(' ', $id);
        if (isset($this->identityMap[$class->rootEntityName][$idHash])) {            
            $entity = $this->identityMap[$class->rootEntityName][$idHash];            
            $oid = spl_object_hash($entity);

突出显示为导致错误的实际行是$id = $this->identifierFlattener->flattenIdentifier($class, $data);

从我的数组中删除'metaDataForm'=>$metaDataForm->createView(),,删除错误,因此它似乎是导致错误的表单呈现。

1 个答案:

答案 0 :(得分:0)

增加php.ini中的PHP内存使用量