diff options
author | Remi Collet <fedora@famillecollet.com> | 2010-11-01 09:25:57 +0100 |
---|---|---|
committer | Remi Collet <fedora@famillecollet.com> | 2010-11-01 09:25:57 +0100 |
commit | 72eaeb9aedf14936ae7601ed0ac61c4014943129 (patch) | |
tree | 101e1a68f27664718a4d2196988cb570b886caff /class/CommonTable.php | |
parent | c28b13eaeca04574994d5a7c2320bbce4c63450f (diff) |
add TableAcls class ans use it in refresh
Diffstat (limited to 'class/CommonTable.php')
-rw-r--r-- | class/CommonTable.php | 20 |
1 files changed, 20 insertions, 0 deletions
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 |