Rebuild the index for the given product IDs

@param array $prodIds List of product IDs
345305
protected function rebuildIndex( array $prodIds )
	{
		$context = $this->getContext();
		$productManager = \Aimeos\MShop\Factory::createManager( $context, 'product' );

		$search = $productManager->createSearch();
		$search->setConditions( $search->compare( '==', 'product.id', $prodIds ) );
		$search->setSlice( 0, count( $prodIds ) );

		$indexManager = \Aimeos\MShop\Factory::createManager( $context, 'index' );
		$indexManager->rebuildIndex( $productManager->searchItems( $search ) );
	}
949533
public function setProductId( $id )
	{
		if ( $id == $this->getProductId() ) { return; }

		$this->_values['prodid'] = (string) $id;
		$this->setModified();
	}
997460
private function updateChildren(array $ids)
    {
        if (count($ids) < 1) {
            return;
        }

        foreach ($ids as $id) {
            $alias = $this->db->fetchColumn('SELECT alias FROM tl_page WHERE id=?', [$id]);
            $alias = $this->cleanAlias($alias);

            $this->db->update('tl_page', ['alias' => $alias], ['id' => $id]);
        }
    }
1358104
private function rebuildNode(\SimpleXMLElement $nodeConfig, $idPrefix)
    {
        /** @var \SimpleXMLElement $node */
        foreach ($nodeConfig as $nodeName => $node) {
            $nodeId = (string) @$node['id'];
            if (in_array($nodeName, $this->processorsNodeNames) && !$nodeId) {
                $autoGeneratedId = $idPrefix.'.'.$this->rebuiltNodesCounter++;
                if ($this->getContainer()->has($autoGeneratedId)) {
                    throw new InvalidConfigurationException('Itinerary name used twice: '.$autoGeneratedId);
                }
                $node->addAttribute('id', $autoGeneratedId);
            }

            $this->rebuildNode($node, $idPrefix);
        }
    }
75344
public function move($fileIDs, $parentID)
    {
        if (is_array($fileIDs)) {
            $fileIDs = implode(',', $fileIDs);
        }

        $data = [
            'file_ids'  => $fileIDs,
            'parent_id' => $parentID
        ];

        return $this->post('files/move', $data, \true);
    }
748515
public function setProductId($product_id) {

        $this->checkInArray($product_id, GDAXConstants::$productIdValues);
        $this->product_id = $product_id;
        return $this;

    }
227275
public function editProductBundle($product_id)
    {
        $this->setProductProductBundle($product_id);
        $this->setTitleEditProductBundle();
        $this->setBreadcrumbEditProductBundle();

        $this->setData('product', $this->data_product);

        $this->submitEditProductBundle();
        $this->setDataItemsProductBundle();
        $this->outputEditProductBundle();
    }
51283
public function setIds(array $ids)
    {
        $this->ids = [];
        $this->idsAsAddresses = [];
        foreach ($ids as $id) {
            $this->idsAsAddresses[] = new Address($id);
            $this->ids[] = $id;
        }
    }
82184
public function getByProductIds(array $productIds, $storeId)
    {
        $searchQueryTable = $this->getTable('search_query');
        $select = $this->getBaseSelect()
            ->joinInner($searchQueryTable, "main_table.query_id = {$searchQueryTable}.query_id", [])
            ->where('product_id IN(?)', $productIds)
            ->where('store_id = ?', $storeId)
            ->columns(['product_id', 'query_id', 'position', 'is_blacklisted']);

        return $this->getConnection()->fetchAll($select);
    }
1088416
protected function getProductItems( \Aimeos\MShop\Context\Item\Iface $context, array $prodIds )
	{
		$productManager = \Aimeos\MShop::create( $context, 'product' );

		$search = $productManager->createSearch( true );
		$expr = array(
			$search->compare( '==', 'product.id', $prodIds ),
			$search->getConditions(),
		);
		$search->setConditions( $search->combine( '&&', $expr ) );
		$search->setSlice( 0, count( $prodIds ) );

		return $productManager->searchItems( $search, array( 'text', 'price', 'media' ) );
	}
75547
public function setIds(array $ids)
    {
        $actualIds = [];

        foreach ($ids as $id) {
            $this->assertValidId($id);
            $actualIds[] = $id;
        }

        $this->clearCachedValueIf($this->ids != $actualIds);
        $this->ids = $actualIds;
    }
940037
public function rebuildIndex( array $items = array() )
	{
		if( empty( $items ) ) { return; }

		MW_Common_Abstract::checkClassList( 'MShop_Product_Item_Interface', $items );

		$context = $this->_getContext();
		$locale = $context->getLocale();
		$siteid = $context->getLocale()->getSiteId();
		$editor = $context->getEditor();
		$date = date( 'Y-m-d H:i:s' );


		$dbm = $context->getDatabaseManager();
		$dbname = $this->_getResourceName();
		$conn = $dbm->acquire( $dbname );

		try
		{
			foreach( $items as $item )
			{
				$parentId = $item->getId(); // array id != $item->getId() for sub-products

				$listTypes = array();
				foreach( $item->getListItems( 'text' ) as $listItem ) {
					$listTypes[ $listItem->getRefId() ][] = $listItem->getType();
				}

				$stmt = $this->_getCachedStatement( $conn, 'mshop/catalog/manager/index/text/default/item/insert' );

				foreach( $item->getRefItems( 'text' ) as $refId => $refItem )
				{
					if( !isset( $listTypes[$refId] ) ) {
						$msg = sprintf( 'List type for text item with ID "%1$s" not available', $refId );
						throw new MShop_Catalog_Exception( $msg );
					}

					foreach( $listTypes[$refId] as $listType )
					{
						$this->_saveText(
							$stmt, $parentId, $siteid, $refId, $refItem->getLanguageId(), $listType,
							$refItem->getType(), 'product', $refItem->getContent(), $date, $editor
						);
					}
				}

				$names = $item->getRefItems( 'text', 'name' );

				if( empty( $names ) )
				{
					$this->_saveText(
						$stmt, $parentId, $siteid, null, $locale->getLanguageId(), 'default',
						'name', 'product', $item->getLabel(), $date, $editor
					);
				}
			}

			$dbm->release( $conn, $dbname );

		}
		catch( Exception $e )
		{
			$dbm->release( $conn, $dbname );
			throw $e;
		}

		$this->_saveAttributeTexts( $items );

		foreach( $this->_getSubManagers() as $submanager ) {
			$submanager->rebuildIndex( $items );
		}
	}
1157832
public function cleanupNodesWithIds($ids)
    {
        $ids = array_merge($this->getRelatedNodeIds($ids), $ids);

        if (!empty($ids)) {
            $repositories = $this->getNodeRepositories($ids);

            //delete all the nodes
            $this->getService('repos:base.node')->destroy($ids);

            //set the creator,updator,authors to null
            $in = '('.implode(',', $ids).')';
            $query[] = "last_comment_id = IF(last_comment_id IN $in, NULL, last_comment_id)";
            $query[] = "created_by = IF(created_by IN $in, NULL, created_by)";
            $query[] = "modified_by = IF(modified_by IN $in, NULL, modified_by)";
            $query[] = "last_comment_by = IF(last_comment_by IN $in, NULL, last_comment_by)";
            $query = implode(', ', $query);
            $where = $this->getService('repos:base.node')
                        ->getQuery()
                        ->where("last_comment_by IN $in OR created_by IN $in OR modified_by IN $in OR last_comment_by IN $in");

            $this->getService('repos:base.node')->update($query, $where);

            //cleanup all the relationship of every deleted node
            $query = $this->getService('repos:base.edge')
                ->getQuery()
                ->where('nodeA.id', 'IN', $ids)
                ->where('nodeB.id', 'IN', $ids, 'OR');

            $this->getService('repos:base.edge')->destroy($query);

            //now lets the repositories know so they can
            //handle the cleanup
            foreach ($repositories as $repository) {
                $context = $repository->getCommandContext();
                $context->node_ids = $ids;
                $repository->getCommandChain()->run('after.deletenodes', $context);
            }
        }
    }
324116
protected function reindex($entityIds = null)
    {
        if ($entityIds !== null) {
            $this->cleanByIds($entityIds);
        } else {
			$this->cleanAll();
		}

		$connection = $this->getConnection();				      
        $select = $connection->select()->from(
            ['e' => $this->getTable('catalog_product_entity')],
            ['entity_id']
        )
        ->join(
            ['cw' => $this->getTable('store_website')],
            '',
            ['website_id']
        )
        ->join(
            ['cwd' => $this->getTable('catalog_product_index_website')],
            'cw.website_id = cwd.website_id',
            []
        )
        ->join(
            ['csg' => $this->getTable('store_group')],
            'csg.website_id = cw.website_id AND cw.default_group_id = csg.group_id',
            []
        )
        ->join(
            ['cs' => $this->getTable('store')],
            'csg.default_store_id = cs.store_id AND cs.store_id != 0',
            []
        )
        ->join(
            ['pw' => $this->getTable('catalog_product_website')],
            'pw.product_id = e.entity_id AND pw.website_id = cw.website_id',
            []
        );

        // add enable products limitation
        $statusCond = $connection->quoteInto('=?', Status::STATUS_ENABLED);       
        $this->_addAttributeToSelect(
            $select,
            'status',
            'e.entity_id',
            'cs.store_id',
            $statusCond,
            true
        );        
        
        $specialPrice = $this->_addAttributeToSelect(
            $select,
            'special_price',
            'e.entity_id',
            'cs.store_id',
            null,
            true
        );
        
        $specialFrom = $this->_addAttributeToSelect(
            $select,
            'special_from_date',
            'e.entity_id',
            'cs.store_id'
        );
        
        $specialTo = $this->_addAttributeToSelect(
            $select,
            'special_to_date',
            'e.entity_id',
            'cs.store_id'
        );        

        $currentDate = $connection->getDatePartSql('cwd.website_date');
        $specialFromDate = $connection->getDatePartSql($specialFrom);
        $specialToDate = $connection->getDatePartSql($specialTo);
               
        $select->where("{$specialToDate} >= {$currentDate}");
        $select->where("{$specialFromDate} <= {$currentDate}");
        
        if ($entityIds !== null) {
            $select->where('e.entity_id IN(?)', $entityIds);
        }
        
        $this->getConnection()->query(
			$select->insertFromSelect($this->getMainTable(), [], false)
		);
		
        return $this;
    }
253006
public final function setIds(array $ids): void
    {
        foreach ($ids as $id) {
            $this->ids[] = (int) $id;
        }
    }
1285727
public function product( $prodIds )
	{
		if( !empty( $prodIds ) && ( $ids = array_unique( $this->validateIds( (array) $prodIds ) ) ) !== [] ) {
			$this->conditions[] = $this->filter->compare( '==', 'product.id', $ids );
		}

		return $this;
	}
112853
public function add($ids)
    {
        if (!is_null($ids)) {
            if (is_string($ids) &&
                in_array($ids, array(self::ALL, self::SEARCH_RES, self::LARGEST))) {
                $this->_ids = $ids;
            } elseif ($add = $this->_resolveIds($ids)) {
                if (is_array($this->_ids) && !empty($this->_ids)) {
                    foreach ($add as $val) {
                        $this->_ids[] = $val;
                    }
                } else {
                    $this->_ids = $add;
                }
                if (!$this->duplicates) {
                    $this->_ids = (count($this->_ids) > 25000)
                        ? array_unique($this->_ids)
                        : array_keys(array_flip($this->_ids));
                }
            }

            $this->_sorted = is_array($this->_ids) && (count($this->_ids) === 1);
        }
    }