BioTorrents.de’s version of Gazelle
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

mass_user_torrents_editor.class.php 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. #declare(strict_types=1);
  3. /**
  4. * Abstract class
  5. * Mass User-Torrents Editor
  6. *
  7. * A class that deals with mass editing a user's torrents.
  8. *
  9. * This abstract class is used by sub-classes as a way to access the Cache/DB.
  10. *
  11. * It is intended to streamline the process of processing data sent by the
  12. * MASS_USER_TORRENT_TABLE_VIEW class.
  13. *
  14. * It could also be used for other types like collages.
  15. */
  16. abstract class MASS_USER_TORRENTS_EDITOR
  17. {
  18. /**
  19. * The affected DB table
  20. * @var string $Table
  21. */
  22. protected $Table;
  23. /**
  24. * Set the Table
  25. * @param string $Table
  26. */
  27. final public function set_table($Table)
  28. {
  29. $this->Table = db_string($Table);
  30. }
  31. /**
  32. * Get the Table
  33. * @return string $Table
  34. */
  35. final public function get_table()
  36. {
  37. return $this->Table;
  38. }
  39. /**
  40. * The extending class must provide a method to send a query and clear the cache
  41. */
  42. abstract protected function query_and_clear_cache($sql);
  43. /**
  44. * A method to insert many rows into a single table
  45. * Not required in subsequent classes
  46. */
  47. public function mass_add()
  48. {
  49. }
  50. /**
  51. * A method to remove many rows from a table
  52. * The extending class must have a mass_remove method
  53. */
  54. abstract public function mass_remove();
  55. /**
  56. * A method to update many rows in a table
  57. * The extending class must have a mass_update method
  58. */
  59. abstract public function mass_update();
  60. }