src/proxy/ClientTable.php
private function syncDataInternal()
    {
        Console::startProgress(0, $this->getOffsetTotal(), 'Fetch: ' . $this->getName() . ' ');
        $this->_contentRowsCount = 0;

        $dataChunk = [];
        for ($i = 0; $i < $this->getOffsetTotal(); ++$i) {
            $requestData = $this->request($i);

            if (!$requestData) {
                continue;
            }

            if (0 === $i % $this->build->syncRequestsCount) {
                $inserted = $this->insertData($dataChunk);
                $this->_contentRowsCount += $inserted;
                $dataChunk = [];
            }

            Console::updateProgress($i + 1, $this->getOffsetTotal());

            $dataChunk = array_merge($requestData, $dataChunk);
            gc_collect_cycles();
        }

        if (!empty($dataChunk)) {
            $this->insertData($dataChunk);
        }

        Console::endProgress();
    }
private function syncDataInternal()
    {
        Console::startProgress(0, $this->getOffsetTotal(), 'Fetch: ' . $this->getName() . ' ');
        $this->_contentRowsCount = 0;

        $dataChunk = [];
        for ($i = 0; $i < $this->getOffsetTotal(); ++$i) {
            $requestData = $this->request($i);

            if (!$requestData) {
                continue;
            }

            if (0 === $i % $this->build->syncRequestsCount) {
                $inserted = $this->insertData($dataChunk);
                $this->_contentRowsCount += $inserted;
                $dataChunk = [];
            }

            Console::updateProgress($i + 1, $this->getOffsetTotal());

            $dataChunk = array_merge($requestData, $dataChunk);
            gc_collect_cycles();
        }

        if (!empty($dataChunk)) {
            $this->insertData($dataChunk);
        }

        Console::endProgress();
    }
private function syncDataInternal ( ) { Console :: startProgress ( 0 , $ this -> getOffsetTotal ( ) , 'Fetch: ' . $ this -> getName ( ) . ' ' ) ; $ this -> _contentRowsCount = 0 ; $ dataChunk = [ ] ; for ( $ i = 0 ; $ i < $ this -> getOffsetTotal ( ) ; ++ $ i ) { $ requestData = $ this -> request ( $ i ) ; if ( ! $ requestData ) { continue ; } if ( 0 === $ i % $ this -> build -> syncRequestsCount ) { $ inserted = $ this -> insertData ( $ dataChunk ) ; $ this -> _contentRowsCount += $ inserted ; $ dataChunk = [ ] ; } Console :: updateProgress ( $ i + 1 , $ this -> getOffsetTotal ( ) ) ; $ dataChunk = array_merge ( $ requestData , $ dataChunk ) ; gc_collect_cycles ( ) ; } if ( ! empty ( $ dataChunk ) ) { $ this -> insertData ( $ dataChunk ) ; } Console :: endProgress ( ) ; }
Start the data sync.

Fetch the data from remote url and write into the database.

@throws \yii\db\Exception
@see \luya\admin\proxy\ClientBuild::$syncRequestsCount
@since 1.2.1
Start the data sync .