php - Symfony 2: The annotation @ORM\OneToMany declared on property AppBundle\Entity\Genre::$movie does not have a property named "onDelete" -


i've been trying use ondelete="set null" 1 of entities, returns error:

[creation error] annotation @orm\onetomany declared on property appbundle\entity\genre::$movie not have property named "ondelete". available properties: mappedby, targetentity, cascade, fetch, orphanremoval, indexby 

entity looks this:

/**  * movie array  *  * @orm\onetomany(  *      targetentity="appbundle\entity\movie",  *    mappedby="genres",  *      ondelete="set null")  *   */ protected $movie; 

what doing wrong?

you should use "ondelete" property on orm\joincolumn , not on relation. error saying not property of relation. try like:

@orm\joincolumn(name="moviee_id", referencedcolumnname="id", nullable=true, ondelete="set null") 

replace field name per need


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -