Misc updates

Removed __call and __callStatic from main db class, added empty
'truncate' methods to db classes
This commit is contained in:
Timothy Warren 2012-01-30 14:03:16 -05:00
parent b7bef6a82e
commit 2a1ac30308
4 changed files with 30 additions and 36 deletions

View File

@ -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);
}
}
// -------------------------------------------------------------------------

View File

@ -24,4 +24,14 @@ class MySQL extends DB_PDO {
parent::__construct($dsn, $username, $password, $options);
}
/**
* Empty a table
*
* @param string $table
*/
function truncate($table)
{
}
}

View File

@ -24,4 +24,14 @@ class pgSQL extends DB_PDO {
parent::__construct($dsn, $username, $password, $options);
}
/**
* Empty a table
*
* @param string $table
*/
function truncate($table)
{
}
}

View File

@ -24,4 +24,14 @@ class SQLite extends DB_PDO {
parent::__construct($dsn);
}
/**
* Empty a table
*
* @param string $table
*/
function truncate($table)
{
}
}