[TASK] Streamline phpdoc annotations in EXT:extbase
[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 */
27 public function setPersistenceManager(\TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface $persistenceManager);
28
29 /**
30 * Sets the aggregate root objects
31 *
32 * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $objects
33 */
34 public function setAggregateRootObjects(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $objects);
35
36 /**
37 * Sets the deleted entities
38 *
39 * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $entities
40 */
41 public function setDeletedEntities(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $entities);
42
43 /**
44 * Sets the changed objects
45 *
46 * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $entities
47 */
48 public function setChangedEntities(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $entities);
49
50 /**
51 * Commits the current persistence session
52 */
53 public function commit();
54
55 // @todo refactor towards being closer to the Flow backend interface again
56
57 /**
58 * Returns the (internal) identifier for the object, if it is known to the
59 * backend. Otherwise NULL is returned.
60 *
61 * @param object $object
62 * @return string|null The identifier for the object if it is known, or NULL
63 */
64 public function getIdentifierByObject($object);
65
66 /**
67 * Returns the object with the (internal) identifier, if it is known to the
68 * backend. Otherwise NULL is returned.
69 *
70 * @param string $identifier
71 * @param string $className
72 * @return object|null The object for the identifier if it is known, or NULL
73 */
74 public function getObjectByIdentifier($identifier, $className);
75
76 /**
77 * Checks if the given object has ever been persisted.
78 *
79 * @param object $object The object to check
80 * @return bool TRUE if the object is new, FALSE if the object exists in the repository
81 */
82 public function isNewObject($object);
83
84 /**
85 * Returns the number of records matching the query.
86 *
87 * @param \TYPO3\CMS\Extbase\Persistence\QueryInterface $query
88 * @return int
89 */
90 public function getObjectCountByQuery(\TYPO3\CMS\Extbase\Persistence\QueryInterface $query);
91
92 /**
93 * Returns the object data matching the $query.
94 *
95 * @param \TYPO3\CMS\Extbase\Persistence\QueryInterface $query
96 * @return array
97 */
98 public function getObjectDataByQuery(\TYPO3\CMS\Extbase\Persistence\QueryInterface $query);
99 }