Created
September 26, 2012 04:31
-
-
Save oojacoboo/3786041 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function truncateTables($connection = null) { | |
if(!$connection) | |
$connection = $this->con; | |
$tables = $this->getTables(); | |
foreach($tables as $table) { | |
//truncate data from this table | |
$sql = "DELETE FROM [" . $table . "]"; | |
//use the instantiated db connection to process the query | |
$stmt = $connection->prepare($sql); | |
$result = $stmt->execute(); | |
\Debug::toLog($result); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment