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

@ -28,42 +28,6 @@ class DB_PDO extends PDO {
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
/**
* 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);
}
}
// -------------------------------------------------------------------------
/** /**
* Simplifies prepared statements for database queries * Simplifies prepared statements for database queries
* *

View File

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