Explicitly set Id with Doctrine when using “AUTO” strategy

前端 未结 7 700
时光说笑
时光说笑 2020-12-02 05:36

My entity uses this annotation for it\'s ID:

/**
 * @orm:Id
 * @orm:Column(type=\"integer\")
 * @orm:GeneratedValue(s         


        
7条回答
  •  离开以前
    2020-12-02 06:14

    Perhaps what doctrine changed but now right way is:

    $metadata->setIdGeneratorType(\Doctrine\ORM\Mapping\ClassMetadata::GENERATOR_TYPE_NONE);
    

提交回复
热议问题