public function podiumDelete()
    {
        $transaction = static::getDb()->beginTransaction();
        try {
            if (!Podium::getInstance()->db->createCommand()->delete('{{%podium_poll_vote}}', ['poll_id' => $this->id])->execute()) {
                throw new Exception('Poll Votes deleting error!');
            }
            if (!PollAnswer::deleteAll(['poll_id' => $this->id])) {
                throw new Exception('Poll Answers deleting error!');
            }
            if (!$this->delete()) {
                throw new Exception('Poll deleting error!');
            }
            $transaction->commit();
            Log::info('Poll deleted', !empty($this->id) ? $this->id : '', __METHOD__);
            return true;
        } catch (Exception $e) {
            $transaction->rollBack();
            Log::error($e->getMessage(), null, __METHOD__);
        }
        return false;
    }
public function podiumDelete()
    {
        $transaction = static::getDb()->beginTransaction();
        try {
            if (!Podium::getInstance()->db->createCommand()->delete('{{%podium_poll_vote}}', ['poll_id' => $this->id])->execute()) {
                throw new Exception('Poll Votes deleting error!');
            }
            if (!PollAnswer::deleteAll(['poll_id' => $this->id])) {
                throw new Exception('Poll Answers deleting error!');
            }
            if (!$this->delete()) {
                throw new Exception('Poll deleting error!');
            }
            $transaction->commit();
            Log::info('Poll deleted', !empty($this->id) ? $this->id : '', __METHOD__);
            return true;
        } catch (Exception $e) {
            $transaction->rollBack();
            Log::error($e->getMessage(), null, __METHOD__);
        }
        return false;
    }
public function podiumDelete ( ) { $ transaction = static :: getDb ( ) -> beginTransaction ( ) ; try { if ( ! Podium :: getInstance ( ) -> db -> createCommand ( ) -> delete ( '{{%podium_poll_vote}}' , [ 'poll_id' => $ this -> id ] ) -> execute ( ) ) { throw new Exception ( 'Poll Votes deleting error!' ) ; } if ( ! PollAnswer :: deleteAll ( [ 'poll_id' => $ this -> id ] ) ) { throw new Exception ( 'Poll Answers deleting error!' ) ; } if ( ! $ this -> delete ( ) ) { throw new Exception ( 'Poll deleting error!' ) ; } $ transaction -> commit ( ) ; Log :: info ( 'Poll deleted' , ! empty ( $ this -> id ) ? $ this -> id : '' , __METHOD__ ) ; return true ; } catch ( Exception $ e ) { $ transaction -> rollBack ( ) ; Log :: error ( $ e -> getMessage ( ) , null , __METHOD__ ) ; } return false ; }
Performs poll delete with answers and votes.
@return bool
Performs poll delete with answers and votes .