Hi. Excuse me my missknowledge of phalcon, if i am wrong and show me the right way to truncate table.
Now im doing this:
class CurrencyCourse extends \Phalcon\Mvc\Model {
/**
*
* @var integer
*/
public $FROM_ID;
/**
* Independent Column Mapping.
*/
public function columnMap()
{
return array(
'FROM_ID' => 'FROM_ID',
);
}
/**
* Clear all table
*/
public function truncate() {
$this->getDi()->getShared('db')->query("truncate table ".$this->getSource());
}
#or this
/**
* Clear all table
*/
public function truncate() {
// Instantiate the Query
(new \Phalcon\Mvc\Model\Query("truncate table ".$this->getSource(), $this->getDI()))->execute();
}
} But i think it should be less level (C compiled).