protected function getTransaction() { if ($transaction = $this->getDbService()->getCurrentTransaction()) { return $transaction; } throw new \CDbException('Start transaction first before getting it'); }