eZPublishCommunityProject(LegacyStack)  2013.5
eZDBGarbageCollector Class Reference

Public Member Functions

 collectProductCollections ($maxTime=false, $sleepTime=false, $limit=false)
 

Static Public Member Functions

 collectBaskets ($maxTime=false, $sleepTime=false, $limit=false)
 
 collectProductCollectionItemOptions ($maxTime=false, $sleepTime=false, $limit=false)
 
 collectProductCollectionItems ($maxTime=false, $sleepTime=false, $limit=false)
 

Public Attributes

const ITEM_LIMIT = 3000
 

Member Function Documentation

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
$maxTimeThe 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).
$sleepTimeControls how many seconds it will sleep between each batch of cleanup, setting it to false means that it should never sleep.
$limitControls 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.
eZDBGarbageCollector::collectProductCollectionItemOptions (   $maxTime = false,
  $sleepTime = false,
  $limit = false 
)
static

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

Parameters
$maxTimeThe 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).
$sleepTimeControls how many seconds it will sleep between each batch of cleanup, setting it to false means that it should never sleep.
$limitControls 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.
eZDBGarbageCollector::collectProductCollectionItems (   $maxTime = false,
  $sleepTime = false,
  $limit = false 
)
static

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

Parameters
$maxTimeThe 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).
$sleepTimeControls how many seconds it will sleep between each batch of cleanup, setting it to false means that it should never sleep.
$limitControls 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.
eZDBGarbageCollector::collectProductCollections (   $maxTime = false,
  $sleepTime = false,
  $limit = false 
)

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

Parameters
$maxTimeThe 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).
$sleepTimeControls how many seconds it will sleep between each batch of cleanup, setting it to false means that it should never sleep.
$limitControls 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.

Member Data Documentation

const eZDBGarbageCollector::ITEM_LIMIT = 3000

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

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


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