Removes old entries from the storage.

@param integer[] $siteids List of IDs for sites whose entries should be deleted
973809
public function cleanup( array $siteids )
	{
		$path = 'classes/order/manager/base/submanagers';
		$default = array( 'address', 'coupon', 'product', 'service' );

		foreach( $this->_getContext()->getConfig()->get( $path, $default ) as $domain ) {
			$this->getSubManager( $domain )->cleanup( $siteids );
		}

		$this->_cleanup( $siteids, 'mshop/order/manager/base/default/item/delete' );
	}
317580
public function removeMedias(array $mediaIds)
    {
        $mediaMongoIds = array();
        foreach ($mediaIds as $mediaId) {
            $mediaMongoIds[] = new \MongoId($mediaId);
        }

        $qb = $this->createQueryBuilder();
        $qb->remove()
            ->field('id')->in($mediaMongoIds)
            ->getQuery()
            ->execute();
    }
409409
private function removeByChunk(array $ids) {
    $storage = $this->entityTypeManager->getStorage('openy_pef_gxp_mapping');
    $chunks = array_chunk($ids, self::CHUNK_DELETE);

    foreach ($chunks as $chunk) {
      $entities = $storage->loadMultiple($chunk);
      $storage->delete($entities);
      $this->loggerChannel->debug(
        'Chunk of %chunk openy_pef_gxp_mapping entities has been deleted.',
        ['%chunk' => count($chunk)]
      );
    }
  }
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);
            }
        }
    }
117297
public function removeResource(array $resourceIds)
    {
        $response = $this->getUser()->post(
            'source/resource/remove',
            array('id' => $this->getId(), 'resource_ids' => $resourceIds)
        );

        $this->resources = $response['resources'];
    }
265254
function remove_sticky( $ids ) {
            if ( ! is_array( $ids ) ) {
                $ids = array( $ids );
            }

            foreach ( $ids as $id ) {
                // Remove from sticky storage.
                $this->_sticky_storage->remove( $id );

                if ( isset( $this->_notices[ $id ] ) ) {
                    unset( $this->_notices[ $id ] );
                }
            }
        }
33285
private function deleteBlockCollections(array $blockIds, ?int $status = null): void
    {
        $collectionIds = $this->queryHandler->loadBlockCollectionIds($blockIds, $status);
        foreach ($collectionIds as $collectionId) {
            $this->collectionHandler->deleteCollection($collectionId, $status);
        }

        $this->queryHandler->deleteCollectionReferences($blockIds, $status);
    }
831991
public function clear()
	{
		if( $this->prefix ) {
			$this->object->flushByTag( $this->prefix . 'siteid' );
		} else {
			$this->object->flush();
		}
	}
552466
public function purgeForContent($contentId, $locationIds = [])
    {
        if ($this->isSwitchedOff() || !method_exists($this->purgeClient, 'purgeForContent')) {
            return;
        }

        $this->purgeClient->purgeForContent($contentId, $locationIds);
    }
72215
public function removeAuthorsById(array $authorIds)
    {
        $aAuthors = $this->getArrayCopy();
        foreach ($aAuthors as $i => $author) {
            if (in_array($author->id, $authorIds)) {
                unset($aAuthors[$i]);
            }
        }

        $this->exchangeArray($aAuthors);
    }
494878
public function deleteVisits($visitIds)
    {
        $numDeletedVisits = 0;

        foreach ($this->logTablesProvider->getAllLogTables() as $logTable) {
            if ($logTable->getColumnToJoinOnIdVisit()) {
                $numVisits = $this->rawLogDao->deleteFromLogTable($logTable->getName(), $visitIds);
                if ($logTable->getName() === 'log_visit') {
                    $numDeletedVisits = $numVisits;
                }
            }
        }

        return $numDeletedVisits;
    }
770695
public static function setSites($sites)
    {
        self::triggerSetSitesEvent($sites);

        foreach ($sites as $idsite => $site) {
            self::setSiteFromArray($idsite, $site);
        }
    }
912243
private function findWebsiteIdsInTimezoneWithNewDay($websiteIds)
    {
        $timezones = $this->getTimezonesHavingNewDaySinceLastRun();
        $websiteDayHasFinishedSinceLastRun = APISitesManager::getInstance()->getSitesIdFromTimezones($timezones);
        $websiteDayHasFinishedSinceLastRun = array_intersect($websiteDayHasFinishedSinceLastRun, $websiteIds);
        $this->websiteDayHasFinishedSinceLastRun = $websiteDayHasFinishedSinceLastRun;

        if (count($websiteDayHasFinishedSinceLastRun) > 0) {
            $ids = !empty($websiteDayHasFinishedSinceLastRun) ? ", IDs: " . implode(", ", $websiteDayHasFinishedSinceLastRun) : "";
            $this->logger->info("- Will process " . count($websiteDayHasFinishedSinceLastRun)
                . " other websites because the last time they were archived was on a different day (in the website's timezone) "
                . $ids);
        }

        return $websiteDayHasFinishedSinceLastRun;
    }
222916
protected function _cleanup( array $siteids, $cfgpath )
	{
		$dbm = $this->_context->getDatabaseManager();
		$dbname = $this->_getResourceName();
		$conn = $dbm->acquire( $dbname );

		try
		{
			$sql = $this->_context->getConfig()->get( $cfgpath, $cfgpath );
			$sql = str_replace( ':cond', '1=1', $sql );

			$stmt = $conn->create( $sql );

			foreach( $siteids as $siteid )
			{
				$stmt->bind( 1, $siteid, MW_DB_Statement_Abstract::PARAM_INT );
				$stmt->execute()->finish();
			}

			$dbm->release( $conn, $dbname );
		}
		catch( Exception $e )
		{
			$dbm->release( $conn, $dbname );
			throw $e;
		}
	}
424957
protected function clearCache( array $ids, $domain = null )
	{
		$domain = ( $domain !== null ? $domain : strtolower( $this->name ) );
		$tags = array( $domain );

		foreach( $ids as $id ) {
			$tags[] = $domain . '-' . $id;
		}

		$this->context->getCache()->deleteByTags( $tags );
	}
703357
public static function removeByIds($imageIds)
    {
        if (is_array($imageIds)) {
            foreach ($imageIds as $id) {
                if (! $id) {
                    continue;
                }

                self::remove($id);
            }
        } else {
            if (! $imageIds) {
                return;
            }

            self::remove($imageIds);
        }
    }
1290960
public function deleteItems( array $ids )
	{
		/** mshop/product/manager/default/item/delete
		 * Deletes the items matched by the given IDs from the database
		 *
		 * Removes the records specified by the given IDs from the product database.
		 * The records must be from the site that is configured via the
		 * context item.
		 *
		 * The ":cond" placeholder is replaced by the name of the ID column and
		 * the given ID or list of IDs while the site ID is bound to the question
		 * mark.
		 *
		 * The SQL statement should conform to the ANSI standard to be
		 * compatible with most relational database systems. This also
		 * includes using double quotes for table and column names.
		 *
		 * @param string SQL statement for deleting items
		 * @since 2014.03
		 * @category Developer
		 * @see mshop/product/manager/default/item/insert
		 * @see mshop/product/manager/default/item/update
		 * @see mshop/product/manager/default/item/newid
		 * @see mshop/product/manager/default/item/search
		 * @see mshop/product/manager/default/item/count
		 */
		$path = 'mshop/product/manager/default/item/delete';
		$this->_deleteItems( $ids, $this->_getContext()->getConfig()->get( $path, $path ) );
	}