public function actionPush($id)
    {
        if (!$this->module->canPushAgain) {
            throw new ForbiddenHttpException(Module::t('notice', 'Push is forbidden.'));
        }

        $record = $this->findRecord($id);

        if (!$record->isSenderValid()) {
            $error = Module::t(
                'notice',
                'The job isn\'t pushed because {sender} component isn\'t found.',
                ['sender'=>$record->sender_name]
            );
            return $this
                ->error($error)
                ->redirect(['view-details', 'id' => $record->id]);
        }

        if (!$record->isJobValid()) {
            $error = Module::t(
                'notice',
                'The job isn\'t pushed because it must be JobInterface instance.'
            );
            return $this
                ->error($error)
                ->redirect(['view-data', 'id' => $record->id]);
        }

        $uid = $record->getSender()->push($record->createJob());
        $newRecord = PushRecord::find()->byJob($record->sender_name, $uid)->one();

        return $this
            ->success(Module::t('notice', 'The job is pushed again.'))
            ->redirect(['view', 'id' => $newRecord->id]);
    }
public function actionPush($id)
    {
        if (!$this->module->canPushAgain) {
            throw new ForbiddenHttpException(Module::t('notice', 'Push is forbidden.'));
        }

        $record = $this->findRecord($id);

        if (!$record->isSenderValid()) {
            $error = Module::t(
                'notice',
                'The job isn\'t pushed because {sender} component isn\'t found.',
                ['sender'=>$record->sender_name]
            );
            return $this
                ->error($error)
                ->redirect(['view-details', 'id' => $record->id]);
        }

        if (!$record->isJobValid()) {
            $error = Module::t(
                'notice',
                'The job isn\'t pushed because it must be JobInterface instance.'
            );
            return $this
                ->error($error)
                ->redirect(['view-data', 'id' => $record->id]);
        }

        $uid = $record->getSender()->push($record->createJob());
        $newRecord = PushRecord::find()->byJob($record->sender_name, $uid)->one();

        return $this
            ->success(Module::t('notice', 'The job is pushed again.'))
            ->redirect(['view', 'id' => $newRecord->id]);
    }
public function actionPush ( $ id ) { if ( ! $ this -> module -> canPushAgain ) { throw new ForbiddenHttpException ( Module :: t ( 'notice' , 'Push is forbidden.' ) ) ; } $ record = $ this -> findRecord ( $ id ) ; if ( ! $ record -> isSenderValid ( ) ) { $ error = Module :: t ( 'notice' , 'The job isn\'t pushed because {sender} component isn\'t found.' , [ 'sender' => $ record -> sender_name ] ) ; return $ this -> error ( $ error ) -> redirect ( [ 'view-details' , 'id' => $ record -> id ] ) ; } if ( ! $ record -> isJobValid ( ) ) { $ error = Module :: t ( 'notice' , 'The job isn\'t pushed because it must be JobInterface instance.' ) ; return $ this -> error ( $ error ) -> redirect ( [ 'view-data' , 'id' => $ record -> id ] ) ; } $ uid = $ record -> getSender ( ) -> push ( $ record -> createJob ( ) ) ; $ newRecord = PushRecord :: find ( ) -> byJob ( $ record -> sender_name , $ uid ) -> one ( ) ; return $ this -> success ( Module :: t ( 'notice' , 'The job is pushed again.' ) ) -> redirect ( [ 'view' , 'id' => $ newRecord -> id ] ) ; }
Pushes a job again

@param int $id
@throws
@return mixed
Pushes a job again