[CLEANUP] Code cleanup in ext:core/Collection
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Classes / Collection / EditableCollectionInterface.php
1 <?php
2 namespace TYPO3\CMS\Core\Collection;
3
4 /**
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 /**
18 * Interface for collection classes which es enabled to be modified
19 *
20 * @author Steffen Ritter <typo3steffen-ritter.net>
21 */
22 interface EditableCollectionInterface {
23
24 /**
25 * Adds on entry to the collection
26 *
27 * @param mixed $data
28 * @return void
29 */
30 public function add($data);
31
32 /**
33 * Adds a set of entries to the collection
34 *
35 * @param CollectionInterface $other
36 * @return void
37 */
38 public function addAll(CollectionInterface $other);
39
40 /**
41 * Remove the given entry from collection
42 *
43 * Note: not the given "index"
44 *
45 * @param mixed $data
46 * @return void
47 */
48 public function remove($data);
49
50 /**
51 * Removes all entries from the collection
52 *
53 * collection will be empty afterwards
54 *
55 * @return void
56 */
57 public function removeAll();
58
59 }