- Overview
- Getting Started
- Extending Your xPDO Model
- Advanced Features
- xPDO Development
-
Class Reference
-
xPDO
- xPDO.addPackage
- xPDO.beginTransaction
- xPDO.commit
- xPDO.connect
- xPDO.fromJSON
- xPDO.getCollection
- xPDO.getCollectionGraph
- xPDO.getCount
- xPDO.getDebug
- xPDO.getFields
- xPDO.getIterator
- xPDO.getManager
- xPDO.getObject
- xPDO.getObjectGraph
- xPDO.getOption
- xPDO.getTableName
- xPDO.loadClass
- xPDO.log
- xPDO.newObject
- xPDO.newQuery
- xPDO.query
- xPDO.setDebug
- xPDO.setLogLevel
- xPDO.setLogTarget
- xPDO.setOption
- xPDO.toJSON
-
xPDOCacheManager
- xPDOCacheManager.copyFile
- xPDOCacheManager.copyTree
- xPDOCacheManager.delete
- xPDOCacheManager.deleteTree
- xPDOCacheManager.endsWith
- xPDOCacheManager.escapeSingleQuotes
- xPDOCacheManager.get
- xPDOCacheManager.getCachePath
- xPDOCacheManager.getCacheProvider
- xPDOCacheManager.matches
- xPDOCacheManager.replace
- xPDOCacheManager.set
- xPDOCacheManager.writeFile
- xPDOCacheManager.writeTree
- xPDOGenerator
- xPDOManager
- xPDOObject
- xPDOQuery
- xPDORevisionControl
- xPDOTransport
- xPDOValidator
-
xPDO
removeCollection
This method is used to delete multiple objects.
http://api.modxcms.com/xpdo/xPDO.html#removeCollection
Examples
From modSessionHandler:
public function gc($max) { $max = (integer) $this->modx->getOption('session_gc_maxlifetime',null,$max); $maxtime= time() - $max; $result = $this->modx->removeCollection('modSession', array("`access` < {$maxtime}")); return $result; }
Warning
Careful! If you do not specify your criteria correctly, you can wipe out an entire database table!
Careful! If you do not specify your criteria correctly, you can wipe out an entire database table!
Suggest an edit to this page on GitHub (Requires GitHub account. Opens a new window/tab).