Wednesday, January 12, 2011

Symfony Doctrine Delete Row

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.

0 comments:

Post a Comment

 

Blog Info

A Pakistani Website by Originative Systems

Total Pageviews

Tutorial Jinni Copyright © 2015 WoodMag is Modified by Originative Systems