[CLEANUP] Improve the @param/@return/@var PHPDoc
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Classes / Persistence / Generic / BackendInterface.php
1 <?php
2 namespace TYPO3\CMS\Extbase\Persistence\Generic;
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 * A persistence backend interface
19 */
20 interface BackendInterface {
21
22 /**
23 * Set a PersistenceManager instance.
24 *
25 * @param \TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface $persistenceManager
26 * @return void
27 */
28 public function setPersistenceManager(\TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface $persistenceManager);
29
30 /**
31 * Sets the aggregate root objects
32 *
33 * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $objects
34 * @return void
35 */
36 public function setAggregateRootObjects(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $objects);
37
38 /**
39 * Sets the deleted entities
40 *
41 * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $entities
42 * @return void
43 * @api
44 */
45 public function setDeletedEntities(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $entities);
46
47 /**
48 * Sets the changed objects
49 *
50 * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $entities
51 * @return void
52 */
53 public function setChangedEntities(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $entities);
54
55 /**
56 * Commits the current persistence session
57 *
58 * @return void
59 */
60 public function commit();
61
62 // @todo refactor towards being closer to the Flow backend interface again
63
64 /**
65 * Returns the (internal) identifier for the object, if it is known to the
66 * backend. Otherwise NULL is returned.
67 *
68 * @param object $object
69 * @return string|NULL The identifier for the object if it is known, or NULL
70 */
71 public function getIdentifierByObject($object);
72
73 /**
74 * Returns the object with the (internal) identifier, if it is known to the
75 * backend. Otherwise NULL is returned.
76 *
77 * @param string $identifier
78 * @param string $className
79 * @return object|NULL The object for the identifier if it is known, or NULL
80 */
81 public function getObjectByIdentifier($identifier, $className);
82
83 /**
84 * Checks if the given object has ever been persisted.
85 *
86 * @param object $object The object to check
87 * @return bool TRUE if the object is new, FALSE if the object exists in the repository
88 */
89 public function isNewObject($object);
90
91 /**
92 * Returns the number of records matching the query.
93 *
94 * @param \TYPO3\CMS\Extbase\Persistence\QueryInterface $query
95 * @return int
96 * @api
97 */
98 public function getObjectCountByQuery(\TYPO3\CMS\Extbase\Persistence\QueryInterface $query);
99
100 /**
101 * Returns the object data matching the $query.
102 *
103 * @param \TYPO3\CMS\Extbase\Persistence\QueryInterface $query
104 * @return array
105 * @api
106 */
107 public function getObjectDataByQuery(\TYPO3\CMS\Extbase\Persistence\QueryInterface $query);
108 }