Permalink
Browse files

Adding a simple method for comment deletion

  • Loading branch information...
1 parent 205fa9c commit de39198a0e3e3f627bf1e62c69e6009989058f74 @Morail Morail committed with Jan 15, 2010
Showing with 13 additions and 0 deletions.
  1. +13 −0 models/behaviors/commentable.php
@@ -172,6 +172,19 @@ function createComment(&$model, $id, $data = array()){
return false;
}
+ function deleteComment(&$model, $id){
+
+ if(is_null($id) || $id == "")
+ return false;
+
+ $model->Comment->id = $id;
+
+ if($model->Comment->saveField('status', 'deleted')) {
+ return true;
+ }
+ return false;
+ }
+
function getComments(&$model, $options = array()){
$options = array_merge(array('id' => $model->id, 'options' => array()), $options);
$parameters = array();

0 comments on commit de39198

Please sign in to comment.