protected function reduceIndexes(&$resource, array $indexNames)
    {
        $keep = [];
        $keepName = [];
        $totalReduced = 0;
        foreach ($resource->indexes as $index) {
            if (in_array($index->getName(), $indexNames) || in_array($index->getName(), $keepName)) {
                $totalReduced++;
                continue;
            }

            $keep[] = $index;
            $keepName[] = $index->getName();
        }

        $resource->indexes = $keep;

        return $totalReduced;
    }
protected function reduceIndexes(&$resource, array $indexNames)
    {
        $keep = [];
        $keepName = [];
        $totalReduced = 0;
        foreach ($resource->indexes as $index) {
            if (in_array($index->getName(), $indexNames) || in_array($index->getName(), $keepName)) {
                $totalReduced++;
                continue;
            }

            $keep[] = $index;
            $keepName[] = $index->getName();
        }

        $resource->indexes = $keep;

        return $totalReduced;
    }
protected function reduceIndexes ( & $ resource , array $ indexNames ) { $ keep = [ ] ; $ keepName = [ ] ; $ totalReduced = 0 ; foreach ( $ resource -> indexes as $ index ) { if ( in_array ( $ index -> getName ( ) , $ indexNames ) || in_array ( $ index -> getName ( ) , $ keepName ) ) { $ totalReduced ++ ; continue ; } $ keep [ ] = $ index ; $ keepName [ ] = $ index -> getName ( ) ; } $ resource -> indexes = $ keep ; return $ totalReduced ; }
Reduces the indexes from a given resource.

@param CrestApps\CodeGenerator\Models\Resource &$resource
@param array $indexNames

@return mixed
Reduces the indexes from a given resource .