public function afterInsert()
{
if ($this->data['name'] === 'throw_after_insert') {
throw new \RuntimeException('', 1);
}
if ($this->data['name'] === 'insert_commit_transaction') {
if (!$this->db->inTransaction()) {
throw new \RuntimeException('There is no active transaction.');
}
$this->db->commit();
}
}