projects
/
Packages
/
TYPO3.CMS.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bc6cce5
)
[+FEATURE] Extbase (Persistence): Implemented removeAll() to the Persistence Reposito...
author
Jochen Rau
<j.rau@web.de>
Wed, 27 Jan 2010 14:33:56 +0000
(14:33 +0000)
committer
Jochen Rau
<j.rau@web.de>
Wed, 27 Jan 2010 14:33:56 +0000
(14:33 +0000)
typo3/sysext/extbase/Classes/Persistence/Repository.php
patch
|
blob
|
history
diff --git
a/typo3/sysext/extbase/Classes/Persistence/Repository.php
b/typo3/sysext/extbase/Classes/Persistence/Repository.php
index
4283ac8
..
eb3e8e9
100644
(file)
--- a/
typo3/sysext/extbase/Classes/Persistence/Repository.php
+++ b/
typo3/sysext/extbase/Classes/Persistence/Repository.php
@@
-208,6
+208,20
@@
class Tx_Extbase_Persistence_Repository implements Tx_Extbase_Persistence_Reposi
$result = $this->createQuery()->execute();
return $result;
}
+
+ /**
+ * Removes all objects of this repository as if remove() was called for
+ * all of them.
+ *
+ * @return void
+ * @api
+ */
+ public function removeAll() {
+ $this->addedObjects = new Tx_Extbase_Persistence_ObjectStorage();
+ foreach ($this->findAll() as $object) {
+ $this->remove($object);
+ }
+ }
/**
* Finds an object matching the given identifier.