src/wcmf/application/controller/SearchIndexController.php
protected function collect($types) {
    $persistenceFacade = $this->getPersistenceFacade();
    $nodesPerCall = $this->getRequestValue('nodesPerCall');
    foreach ($types as $type) {
      $oids = $persistenceFacade->getOIDs($type);
      $oidLists = array_chunk($oids, self::OPTIMIZE_FREQ);
      for ($i=0, $count=sizeof($oidLists); $i<$count; $i++) {
        $this->addWorkPackage($this->getMessage()->getText('Indexing %0% %1% objects, starting from %2%., ', [sizeof($oids), $type, ($i*self::OPTIMIZE_FREQ+1)]),
                $nodesPerCall, $oidLists[$i], 'index');
        $this->addWorkPackage($this->getMessage()->getText('Optimizing index'),
                1, [0], 'optimize');
      }
    }
  }
protected function collect($types) {
    $persistenceFacade = $this->getPersistenceFacade();
    $nodesPerCall = $this->getRequestValue('nodesPerCall');
    foreach ($types as $type) {
      $oids = $persistenceFacade->getOIDs($type);
      $oidLists = array_chunk($oids, self::OPTIMIZE_FREQ);
      for ($i=0, $count=sizeof($oidLists); $i<$count; $i++) {
        $this->addWorkPackage($this->getMessage()->getText('Indexing %0% %1% objects, starting from %2%., ', [sizeof($oids), $type, ($i*self::OPTIMIZE_FREQ+1)]),
                $nodesPerCall, $oidLists[$i], 'index');
        $this->addWorkPackage($this->getMessage()->getText('Optimizing index'),
                1, [0], 'optimize');
      }
    }
  }
protected function collect ( $ types ) { $ persistenceFacade = $ this -> getPersistenceFacade ( ) ; $ nodesPerCall = $ this -> getRequestValue ( 'nodesPerCall' ) ; foreach ( $ types as $ type ) { $ oids = $ persistenceFacade -> getOIDs ( $ type ) ; $ oidLists = array_chunk ( $ oids , self :: OPTIMIZE_FREQ ) ; for ( $ i = 0 , $ count = sizeof ( $ oidLists ) ; $ i < $ count ; $ i ++ ) { $ this -> addWorkPackage ( $ this -> getMessage ( ) -> getText ( 'Indexing %0% %1% objects, starting from %2%., ' , [ sizeof ( $ oids ) , $ type , ( $ i * self :: OPTIMIZE_FREQ + 1 ) ] ) , $ nodesPerCall , $ oidLists [ $ i ] , 'index' ) ; $ this -> addWorkPackage ( $ this -> getMessage ( ) -> getText ( 'Optimizing index' ) , 1 , [ 0 ] , 'optimize' ) ; } } }
Collect all oids of the given types
@param $types The types to process
@note This is a callback method called on a matching work package @see BatchController::addWorkPackage()
Collect all oids of the given types