From 2a1ac3030888de337d1879e1e51ce95bb0661b04 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Mon, 30 Jan 2012 14:03:16 -0500 Subject: [PATCH] Misc updates Removed __call and __callStatic from main db class, added empty 'truncate' methods to db classes --- src/databases/db_pdo.php | 36 ------------------------------------ src/databases/mysql.php | 10 ++++++++++ src/databases/pgsql.php | 10 ++++++++++ src/databases/sqlite.php | 10 ++++++++++ 4 files changed, 30 insertions(+), 36 deletions(-) diff --git a/src/databases/db_pdo.php b/src/databases/db_pdo.php index 0c2f567..f374a75 100644 --- a/src/databases/db_pdo.php +++ b/src/databases/db_pdo.php @@ -25,42 +25,6 @@ class DB_PDO extends PDO { { parent::__construct($dsn, $username, $password, $driver_options); } - - // ------------------------------------------------------------------------- - - /** - * PHP magic method to facilitate dynamic methods - * - * @param string $name - * @param array $args - */ - function __call($name, $args) - { - if(is_callable($this->$name)) - { - //Add $this to the beginning of the args array - array_unshift($args, $this); - - //Call the dynamic function - return call_user_func_array($this->$name, $args); - } - } - - // ------------------------------------------------------------------------- - - /** - * PHP magic methods to call non-static methods statically - * - * @param string $name - * @param array $args - */ - public static function __callStatic($name, $args) - { - if(is_callable(parent::$name)) - { - return call_user_func_array(parent::$name, $args); - } - } // ------------------------------------------------------------------------- diff --git a/src/databases/mysql.php b/src/databases/mysql.php index 397e62c..a053704 100644 --- a/src/databases/mysql.php +++ b/src/databases/mysql.php @@ -24,4 +24,14 @@ class MySQL extends DB_PDO { parent::__construct($dsn, $username, $password, $options); } + /** + * Empty a table + * + * @param string $table + */ + function truncate($table) + { + + } + } \ No newline at end of file diff --git a/src/databases/pgsql.php b/src/databases/pgsql.php index 7e34d0c..8557e5b 100644 --- a/src/databases/pgsql.php +++ b/src/databases/pgsql.php @@ -24,4 +24,14 @@ class pgSQL extends DB_PDO { parent::__construct($dsn, $username, $password, $options); } + /** + * Empty a table + * + * @param string $table + */ + function truncate($table) + { + + } + } \ No newline at end of file diff --git a/src/databases/sqlite.php b/src/databases/sqlite.php index 845de28..6e8c742 100644 --- a/src/databases/sqlite.php +++ b/src/databases/sqlite.php @@ -24,4 +24,14 @@ class SQLite extends DB_PDO { parent::__construct($dsn); } + /** + * Empty a table + * + * @param string $table + */ + function truncate($table) + { + + } + } \ No newline at end of file