Gazelle/classes/mass_user_torrents_editor.class.php

61 lines
1.3 KiB
PHP
Raw Normal View History

2012-10-29 08:00:20 +00:00
<?php
/**
* Abstract class
* Mass User-Torrents Editor
*
* A class that deals with mass editing a user's torrents.
*
* This abstract class is used by sub-classes as a way to access the Cache/DB.
*
* It is intended to streamline the process of processing data sent by the
* MASS_USER_TORRENT_TABLE_VIEW class.
*
* It could also be used for other types like collages.
*/
2013-08-28 23:08:41 +00:00
abstract class MASS_USER_TORRENTS_EDITOR {
2012-10-29 08:00:20 +00:00
/**
* The affected DB table
* @var string $Table
*/
protected $Table;
/**
* Set the Table
* @param string $Table
*/
2013-08-28 23:08:41 +00:00
final public function set_table($Table) {
2012-10-29 08:00:20 +00:00
$this->Table = db_string($Table);
}
/**
* Get the Table
* @return string $Table
*/
2013-08-28 23:08:41 +00:00
final public function get_table() {
2012-10-29 08:00:20 +00:00
return $this->Table;
}
/**
* The extending class must provide a method to send a query and clear the cache
*/
2013-08-28 23:08:41 +00:00
abstract protected function query_and_clear_cache($sql);
2012-10-29 08:00:20 +00:00
/**
* A method to insert many rows into a single table
* Not required in subsequent classes
*/
2013-08-28 23:08:41 +00:00
public function mass_add() {}
2012-10-29 08:00:20 +00:00
/**
* A method to remove many rows from a table
* The extending class must have a mass_remove method
*/
2013-08-28 23:08:41 +00:00
abstract public function mass_remove();
2012-10-29 08:00:20 +00:00
/**
* A method to update many rows in a table
* The extending class must have a mass_update method
*/
2013-08-28 23:08:41 +00:00
abstract public function mass_update();
2012-10-27 08:00:09 +00:00
}