PluginProbe
CSS & JavaScript Toolbox / 10
CSS & JavaScript Toolbox v10
trunk 0.3 0.8 10 10.1 11 11.2 11.3 11.4 11.5 11.6 11.7 11.8 11.9 11.9.1 12 12.0 12.0.1 12.0.3 12.0.4 12.0.5 12.0.6 12.0.7 6.0 6.0.11 All 60 releases
css-javascript-toolbox / tables / backups.php

backups.php in CSS & JavaScript Toolbox 10, at tables/backups.php

72 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 *
4 */
5
6 // Disallow direct access.
7 defined('ABSPATH') or die("Access denied");
8
9 // Import dependencies.
10 cssJSToolbox::import('framework:db:mysql:table.inc.php');
11
12 /**
13 *
14 */
15 class CJTBackupsTable extends CJTTable {
16
17 /**
18 * put your comment there...
19 *
20 */
21 public function __construct($dbDriver) {
22 parent::__construct($dbDriver, cssJSToolbox::$config->database->tables->backups);
23 }
24
25 /**
26 * put your comment there...
27 *
28 * @param mixed $key
29 */
30 public function delete($key) {
31 // Where clause filters.
32 $where = '';
33 $key = $this->prepareQueryParameters($key);
34 $key = implode(' AND ', $key);
35 if ($key) {
36 $where = " WHERE {$key}";
37 }
38 // Delete backup.
39 $query = "DELETE FROM {$this->table}{$where}";
40 $this->dbDriver->delete($query);
41 }
42
43 /**
44 * put your comment there...
45 *
46 * @param mixed $type
47 */
48 public function get($type) {
49 // Select all backups for specific backup type.
50 $query = "SELECT id, name, owner, created
51 FROM {$this->table}
52 WHERE type = '{$type}'";
53 // Use id field as array key.
54 $backups = $this->dbDriver->select($query, OBJECT);
55 return $backups;
56 }
57
58 /**
59 * put your comment there...
60 *
61 * @param mixed $backup
62 */
63 public function insert($data) {
64 // Prepare insert statement fields.
65 $data = $this->prepareQueryParameters($data);
66 $data = implode(',', $data);
67 // Build insert statement.
68 $query = "INSERT INTO {$this->table} SET {$data}";
69 $this->dbDriver->insert($query);
70 }
71
72 } // End class.