a1337q
a1337q

Reputation: 780

Symfony2 & Doctrine set foreign key to null

I want to unset a nullable foreign key in my table cookie, which is here represented as ORM entity object $cookie:

$cookie->setFsession(new Doctrine_Null());
$this->em->persist($cookie);
$this->em->flush();

But I get

Fatal error: Class 'GroupConsulter\dotplus\FrontEndBundle\Doctrine_Null' not found

What am I missing? Thanks

Upvotes: 0

Views: 967

Answers (1)

Cyprian
Cyprian

Reputation: 11364

What is Doctrine_Null class? If you added some vendor with this class you need use appropriate namespace for it.

But for you needs, just enough will be:

$cookie->setFsession(null);

Upvotes: 0

Related Questions