<tutorialjinni.com/>

Symfony Doctrine Delete Row

Posted Under: Doctrine, PHP, Programming, Symfony, Tutorials on Jan 12, 2011
In this tutorial we will delete a Row from database using Doctrine, lets do it with a simple example.
public function executeDelete(sfWebRequest $request){

        Doctrine::getTable('User')
        ->findBy('id', $request->getParameter('id'))
        ->delete();

        $this->redirect('SOME/PAGE');
        $this->setTemplate(false);

    }
Doctrine simplify our CRUD operations, here we just give Id of the record to be deleted and use delete() method or Doctrine to remove that record.
© Tutorial Jinni