From 72eaeb9aedf14936ae7601ed0ac61c4014943129 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 1 Nov 2010 09:25:57 +0100 Subject: add TableAcls class ans use it in refresh --- class/CommonTable.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'class/CommonTable.php') diff --git a/class/CommonTable.php b/class/CommonTable.php index 0aeeb29..b7cc93e 100644 --- a/class/CommonTable.php +++ b/class/CommonTable.php @@ -306,6 +306,26 @@ abstract class CommonTable } return $tab; } + + /** + * Truncate the table + */ + public function truncate() + { + return $this->exec('TRUNCATE `'.$this->table.'`'); + } + + /** + * Get the number of rows in the table + */ + public function getCount() + { + $sql = 'SELECT COUNT(*) AS cpt FROM `'.$this->table.'`'; + foreach ($this->request($sql) as $row) { + return ($row['cpt']); + } + return 0; + } } ?> \ No newline at end of file -- cgit