public function nextDrop()
    {
        $drops = $this->countDrops();
        if (count($drops)) {
            $currentStep = Yii::$app->session->get(self::SESSION_KEY, 0);
            $maxStep = Yii::$app->session->get(self::SESSION_STEPS, 0);
            if ($currentStep < $maxStep) {
                $this->type = self::TYPE_ERROR;
                $this->table = '...';

                if (!isset($drops[$currentStep])) {
                    return [
                        'drop' => false,
                        'type' => $this->type,
                        'result' => Yii::t('podium/flash', 'Installation aborted! Can not find the requested drop step.'),
                        'percent' => 100,
                    ];
                }

                $this->table = $drops[$currentStep]['table'];

                $result = $this->dropTable();
                if ($result === true) {
                    Yii::$app->session->set(self::SESSION_KEY, ++$currentStep);
                    return $this->nextDrop();
                }

                Yii::$app->session->set(self::SESSION_KEY, ++$currentStep);
                return [
                    'drop' => true,
                    'type' => $this->type,
                    'result' => $result,
                    'table' => $this->rawTable,
                    'percent' => $this->countPercent($currentStep, $maxStep),
                ];
            }
        }
        Yii::$app->session->set(self::SESSION_KEY, 0);
        return $this->nextStep();
    }
public function nextDrop()
    {
        $drops = $this->countDrops();
        if (count($drops)) {
            $currentStep = Yii::$app->session->get(self::SESSION_KEY, 0);
            $maxStep = Yii::$app->session->get(self::SESSION_STEPS, 0);
            if ($currentStep < $maxStep) {
                $this->type = self::TYPE_ERROR;
                $this->table = '...';

                if (!isset($drops[$currentStep])) {
                    return [
                        'drop' => false,
                        'type' => $this->type,
                        'result' => Yii::t('podium/flash', 'Installation aborted! Can not find the requested drop step.'),
                        'percent' => 100,
                    ];
                }

                $this->table = $drops[$currentStep]['table'];

                $result = $this->dropTable();
                if ($result === true) {
                    Yii::$app->session->set(self::SESSION_KEY, ++$currentStep);
                    return $this->nextDrop();
                }

                Yii::$app->session->set(self::SESSION_KEY, ++$currentStep);
                return [
                    'drop' => true,
                    'type' => $this->type,
                    'result' => $result,
                    'table' => $this->rawTable,
                    'percent' => $this->countPercent($currentStep, $maxStep),
                ];
            }
        }
        Yii::$app->session->set(self::SESSION_KEY, 0);
        return $this->nextStep();
    }
public function nextDrop ( ) { $ drops = $ this -> countDrops ( ) ; if ( count ( $ drops ) ) { $ currentStep = Yii :: $ app -> session -> get ( self :: SESSION_KEY , 0 ) ; $ maxStep = Yii :: $ app -> session -> get ( self :: SESSION_STEPS , 0 ) ; if ( $ currentStep < $ maxStep ) { $ this -> type = self :: TYPE_ERROR ; $ this -> table = '...' ; if ( ! isset ( $ drops [ $ currentStep ] ) ) { return [ 'drop' => false , 'type' => $ this -> type , 'result' => Yii :: t ( 'podium/flash' , 'Installation aborted! Can not find the requested drop step.' ) , 'percent' => 100 , ] ; } $ this -> table = $ drops [ $ currentStep ] [ 'table' ] ; $ result = $ this -> dropTable ( ) ; if ( $ result === true ) { Yii :: $ app -> session -> set ( self :: SESSION_KEY , ++ $ currentStep ) ; return $ this -> nextDrop ( ) ; } Yii :: $ app -> session -> set ( self :: SESSION_KEY , ++ $ currentStep ) ; return [ 'drop' => true , 'type' => $ this -> type , 'result' => $ result , 'table' => $ this -> rawTable , 'percent' => $ this -> countPercent ( $ currentStep , $ maxStep ) , ] ; } } Yii :: $ app -> session -> set ( self :: SESSION_KEY , 0 ) ; return $ this -> nextStep ( ) ; }
Proceeds next drop step.
@return array
@since 0.2
Proceeds next drop step .