lithium\test\Fixture::truncate()
Truncates the current fixture.
Parameters
-
boolean
$soft
If
true
and there's no existing schema, no truncate is generated.
Returns
booleanSource
public function truncate($soft = true) {
$connections = $this->_classes['connections'];
$db = $connections::get($this->_connection);
if ($soft && $db::enabled('sources')) {
$sources = $db->sources();
if(!in_array($this->_source, $sources)) {
return true;
}
}
$options = ['source' => $this->_source];
$query = Libraries::instance(null, 'query', $options, $this->_classes);
return $db->delete($query);
}