SproutCMS

This is the code documentation for the SproutCMS project

source of /sprout/Helpers/Moderate.php

  1. <?php
  2. /*
  3.  * Copyright (C) 2017 Karmabunny Pty Ltd.
  4.  *
  5.  * This file is a part of SproutCMS.
  6.  *
  7.  * SproutCMS is free software: you can redistribute it and/or modify it under the terms
  8.  * of the GNU General Public License as published by the Free Software Foundation, either
  9.  * version 2 of the License, or (at your option) any later version.
  10.  *
  11.  * For more information, visit <http://getsproutcms.com>.
  12.  */
  13.  
  14. namespace Sprout\Helpers;
  15.  
  16. abstract class Moderate {
  17. protected $friendly_name = '- No name -';
  18. protected $db;
  19.  
  20.  
  21.  
  22. public function __construct()
  23. {
  24. }
  25.  
  26.  
  27. /**
  28.   * Return the 'friendly' name of this item
  29.   **/
  30. public final function getFriendlyName() {
  31. return $this->friendly_name;
  32. }
  33.  
  34.  
  35. /**
  36.   * Return an array of one or more items which need moderating.
  37.   *
  38.   * The array should have the following format:
  39.   * [] = array('id' => 'html')
  40.   * id record identifier
  41.   * html record preview html
  42.   *
  43.   * Return NULL on error
  44.   **/
  45. public function getList()
  46. {
  47. return NULL;
  48. }
  49.  
  50.  
  51. /**
  52.   * Approve the specified item.
  53.   * This is called from within a transaction.
  54.   **/
  55. public abstract function approve($id);
  56.  
  57.  
  58. /**
  59.   * Delete the specified item.
  60.   * Usually the best is to use the controller _deleteSave method.
  61.   * This is called from within a transaction.
  62.   **/
  63. public abstract function delete($id);
  64.  
  65. }
  66.  
  67.  
  68.