Deny Delete

If the attribute of any dataset in table points to the dataset of this table which is supposed to be deleted, deleting will not be performed.

Parameters:

  • table: the table to delete from
  • attribute: the attribute table that is the foreign key pointing to this table
  • message: a message that is shown if deleting was denied
Sample Code


// create form object
$forms = new pnFormTrash("people");
$forms->edit("lastname", "firstname");
$forms->show("lastname", "firstname");

$forms->registerHandler("denydelete", 
    array(
        "table"=>"people", 
        "attribute"=>"color", 
        "message"=>"Can't delete ... still people with this color."
    )
);

// create html
$forms->doit(); 

Live Sample

  1. No comments yet.
  1. No trackbacks yet.
You must be logged in to post a comment.