public function getIndexesGroupedByCollection($storeName)
    {
        $indexes = $this->indexes[$storeName];
        //TODO: if we have much more default indexes we should find a better way of doing this
        foreach($indexes as $collection=>$indices) {
            $indexes[$collection][_LOCKED_FOR_TRANS_INDEX] = array(_ID_KEY=>1, _LOCKED_FOR_TRANS=>1);
            $indexes[$collection][_UPDATED_TS_INDEX] = array(_ID_KEY=>1, _UPDATED_TS=>1);
            $indexes[$collection][_CREATED_TS_INDEX] = array(_ID_KEY=>1, _CREATED_TS=>1);
        }

        // also add the indexes for any views/tables
        $tableIndexes = [];
        foreach ($this->getTableSpecifications($storeName) as $tspec)
        {
            if (array_key_exists("ensureIndexes",$tspec))
            {
                // Indexes should be keyed by data_source
                if(!isset($tableIndexes[$tspec['to_data_source']]))
                {
                    $tableIndexes[$tspec['to_data_source']] = [];
                }
                foreach ($tspec["ensureIndexes"] as $index)
                {
                    $tableIndexes[$tspec['to_data_source']][] = $index;
                }
            }
        }
        $indexes[TABLE_ROWS_COLLECTION] = $tableIndexes;

        $viewIndexes = [];
        foreach ($this->getViewSpecifications($storeName) as $vspec)
        {
            if (array_key_exists("ensureIndexes",$vspec))
            {
                // Indexes should be keyed by data_source
                if(!isset($viewIndexes[$vspec['to_data_source']]))
                {
                    $viewIndexes[$vspec['to_data_source']] = [];
                }
                foreach ($vspec["ensureIndexes"] as $index)
                {
                    $viewIndexes[$vspec['to_data_source']][] = $index;
                }
            }
        }
        $indexes[VIEWS_COLLECTION] = $viewIndexes;

        return $indexes;
    }
public function getIndexesGroupedByCollection($storeName)
    {
        $indexes = $this->indexes[$storeName];
        //TODO: if we have much more default indexes we should find a better way of doing this
        foreach($indexes as $collection=>$indices) {
            $indexes[$collection][_LOCKED_FOR_TRANS_INDEX] = array(_ID_KEY=>1, _LOCKED_FOR_TRANS=>1);
            $indexes[$collection][_UPDATED_TS_INDEX] = array(_ID_KEY=>1, _UPDATED_TS=>1);
            $indexes[$collection][_CREATED_TS_INDEX] = array(_ID_KEY=>1, _CREATED_TS=>1);
        }

        // also add the indexes for any views/tables
        $tableIndexes = [];
        foreach ($this->getTableSpecifications($storeName) as $tspec)
        {
            if (array_key_exists("ensureIndexes",$tspec))
            {
                // Indexes should be keyed by data_source
                if(!isset($tableIndexes[$tspec['to_data_source']]))
                {
                    $tableIndexes[$tspec['to_data_source']] = [];
                }
                foreach ($tspec["ensureIndexes"] as $index)
                {
                    $tableIndexes[$tspec['to_data_source']][] = $index;
                }
            }
        }
        $indexes[TABLE_ROWS_COLLECTION] = $tableIndexes;

        $viewIndexes = [];
        foreach ($this->getViewSpecifications($storeName) as $vspec)
        {
            if (array_key_exists("ensureIndexes",$vspec))
            {
                // Indexes should be keyed by data_source
                if(!isset($viewIndexes[$vspec['to_data_source']]))
                {
                    $viewIndexes[$vspec['to_data_source']] = [];
                }
                foreach ($vspec["ensureIndexes"] as $index)
                {
                    $viewIndexes[$vspec['to_data_source']][] = $index;
                }
            }
        }
        $indexes[VIEWS_COLLECTION] = $viewIndexes;

        return $indexes;
    }
public function getIndexesGroupedByCollection ( $ storeName ) { $ indexes = $ this -> indexes [ $ storeName ] ; //TODO: if we have much more default indexes we should find a better way of doing this foreach ( $ indexes as $ collection => $ indices ) { $ indexes [ $ collection ] [ _LOCKED_FOR_TRANS_INDEX ] = array ( _ID_KEY => 1 , _LOCKED_FOR_TRANS => 1 ) ; $ indexes [ $ collection ] [ _UPDATED_TS_INDEX ] = array ( _ID_KEY => 1 , _UPDATED_TS => 1 ) ; $ indexes [ $ collection ] [ _CREATED_TS_INDEX ] = array ( _ID_KEY => 1 , _CREATED_TS => 1 ) ; } // also add the indexes for any views/tables $ tableIndexes = [ ] ; foreach ( $ this -> getTableSpecifications ( $ storeName ) as $ tspec ) { if ( array_key_exists ( "ensureIndexes" , $ tspec ) ) { // Indexes should be keyed by data_source if ( ! isset ( $ tableIndexes [ $ tspec [ 'to_data_source' ] ] ) ) { $ tableIndexes [ $ tspec [ 'to_data_source' ] ] = [ ] ; } foreach ( $ tspec [ "ensureIndexes" ] as $ index ) { $ tableIndexes [ $ tspec [ 'to_data_source' ] ] [ ] = $ index ; } } } $ indexes [ TABLE_ROWS_COLLECTION ] = $ tableIndexes ; $ viewIndexes = [ ] ; foreach ( $ this -> getViewSpecifications ( $ storeName ) as $ vspec ) { if ( array_key_exists ( "ensureIndexes" , $ vspec ) ) { // Indexes should be keyed by data_source if ( ! isset ( $ viewIndexes [ $ vspec [ 'to_data_source' ] ] ) ) { $ viewIndexes [ $ vspec [ 'to_data_source' ] ] = [ ] ; } foreach ( $ vspec [ "ensureIndexes" ] as $ index ) { $ viewIndexes [ $ vspec [ 'to_data_source' ] ] [ ] = $ index ; } } } $ indexes [ VIEWS_COLLECTION ] = $ viewIndexes ; return $ indexes ; }
Returns a list of the configured indexes grouped by collection
@param string $storeName
@return array
Returns a list of the configured indexes grouped by collection