Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding a simple method for comment deletion

  • Loading branch information...
commit de39198a0e3e3f627bf1e62c69e6009989058f74 1 parent 205fa9c
@Morail Morail authored committed
Showing with 13 additions and 0 deletions.
  1. +13 −0 models/behaviors/commentable.php
View
13 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();
Please sign in to comment.
Something went wrong with that request. Please try again.