How can I do set NULL into the table in Doctrine

You can use method set('u.name', 'NULL') For example:

Doctrine_Query::create()->update('User u')->set('u.name', 'NULL')->where('u.id = ?',$id);

I would try one of the following:

1:

$record = $table->getTable()->find( $id );
$record->parent_id = new Doctrine_Null();
$record->save();

2:

$record = $table->getTable()->find( $id );
$record->parent_id = "NULL";
$record->save();

I have not tested these, but I do recall having a similar issue prior, just cannot recall how I solved it. Hope this helps!

Tags:

Php

Doctrine