Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
eZDBGarbageCollector Class Reference

## Public Member Functions
| collectProductCollections ( $maxTime=false, $sleepTime=false, $limit=false)

## Static Public Member Functions
| collectBaskets ( $maxTime=false, $sleepTime=false, $limit=false)
| collectProductCollectionItems ( $maxTime=false, $sleepTime=false, $limit=false)
| collectProductCollectionItemOptions ( $maxTime=false, $sleepTime=false, $limit=false)

## Public Attributes
const | ITEM_LIMIT = 3000

## Detailed Description

Definition at line 32 of file ezdbgarbagecollector.php.

## Member Function Documentation

## ◆ collectBaskets()

eZDBGarbageCollector::collectBaskets | ( |  | $maxTime = `false`,
|  |  | $sleepTime = `false`,
|  |  | $limit = `false`
| ) |  |
| static

Removes all baskets which are missing a session entry. This usually means the basket was not cleaned up when the session was removed.

Parameters

  $maxTime | The maximum number of seconds the collector should run. If set to `false` or `true` it will continue until all garbage is collected, `false` means to try the fastest way possible (may use lots of resources).
  $sleepTime | Controls how many seconds it will sleep between each batch of cleanup, setting it to `false` means that it should never sleep.
  $limit | Controls how many items are cleaned in one batch operation, a value of `false` means to use default value.

Note
  The function will most likely use a little more time than $maxTime so don't depend on it to be accurate.
  This will also remove the product collection the basket is using.
  Transaction unsafe. If you call several transaction unsafe methods you must enclose the calls within a db transaction; thus within db->begin and db->commit.

Definition at line 60 of file ezdbgarbagecollector.php.

References eZProductCollection\cleanupList(), eZDB\instance(), and ITEM_LIMIT.

## ◆ collectProductCollectionItemOptions()

eZDBGarbageCollector::collectProductCollectionItemOptions | ( |  | $maxTime = `false`,
|  |  | $sleepTime = `false`,
|  |  | $limit = `false`
| ) |  |
| static

Removes all product collection item options which are missing a product collection item.

Parameters

  $maxTime | The maximum number of seconds the collector should run. If set to `false` or `true` it will continue until all garbage is collected, `false` means to try the fastest way possible (may use lots of resources).
  $sleepTime | Controls how many seconds it will sleep between each batch of cleanup, setting it to `false` means that it should never sleep.
  $limit | Controls how many items are cleaned in one batch operation, a value of `false` means to use default value.

Note
  The function will most likely use a little more time than $maxTime so don't depend on it to be accurate.
  Transaction unsafe. If you call several transaction unsafe methods you must enclose the calls within a db transaction; thus within db->begin and db->commit.

Definition at line 353 of file ezdbgarbagecollector.php.

References eZDB\instance(), and ITEM_LIMIT.

## ◆ collectProductCollectionItems()

eZDBGarbageCollector::collectProductCollectionItems | ( |  | $maxTime = `false`,
|  |  | $sleepTime = `false`,
|  |  | $limit = `false`
| ) |  |
| static

Removes all product collection items which are missing a product collection.

Parameters

  $maxTime | The maximum number of seconds the collector should run. If set to `false` or `true` it will continue until all garbage is collected, `false` means to try the fastest way possible (may use lots of resources).
  $sleepTime | Controls how many seconds it will sleep between each batch of cleanup, setting it to `false` means that it should never sleep.
  $limit | Controls how many items are cleaned in one batch operation, a value of `false` means to use default value.

Note
  The function will most likely use a little more time than $maxTime so don't depend on it to be accurate.
  This will also remove the product collection item option the item is using.
  Transaction unsafe. If you call several transaction unsafe methods you must enclose the calls within a db transaction; thus within db->begin and db->commit.

Definition at line 268 of file ezdbgarbagecollector.php.

References eZProductCollectionItemOption\cleanupList(), eZDB\instance(), and ITEM_LIMIT.

## ◆ collectProductCollections()

eZDBGarbageCollector::collectProductCollections | ( |  | $maxTime = `false`,
|  |  | $sleepTime = `false`,
|  |  | $limit = `false`
| ) |  |

Removes entries from ezproductcollection which is missing relations to other tables.

Parameters

  $maxTime | The maximum number of seconds the collector should run. If set to `false` or `true` it will continue until all garbage is collected, `false` means to try the fastest way possible (may use lots of resources).
  $sleepTime | Controls how many seconds it will sleep between each batch of cleanup, setting it to `false` means that it should never sleep.
  $limit | Controls how many items are cleaned in one batch operation, a value of `false` means to use default value.

Note
  The function will most likely use a little more time than $maxTime so don't depend on it to be accurate.
  The current code hardcodes the related tables.

Warning
  This code may be very slow on large sites.

Note
  Transaction unsafe. If you call several transaction unsafe methods you must enclose the calls within a db transaction; thus within db->begin and db->commit.

Definition at line 153 of file ezdbgarbagecollector.php.

References eZProductCollectionItem\cleanupList(), eZDB\instance(), and ITEM_LIMIT.

## Member Data Documentation

## ◆ ITEM_LIMIT

const eZDBGarbageCollector::ITEM_LIMIT = 3000

Controls the default value for how many items are cleaned in one batch operation.

Definition at line 37 of file ezdbgarbagecollector.php.

Referenced by collectBaskets(), collectProductCollectionItemOptions(), collectProductCollectionItems(), and collectProductCollections().

The documentation for this class was generated from the following file:

- ezdbgarbagecollector.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.