[CLEANUP] The correct case must be used for standard PHP types in 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 */
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 * @api
41 */
42 public function setDeletedEntities(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $entities);
43
44 /**
45 * Sets the changed objects
46 *
47 * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $entities
48 */
49 public function setChangedEntities(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $entities);
50
51 /**
52 * Commits the current persistence session
53 */
54 public function commit();
55
56 // @todo refactor towards being closer to the Flow backend interface again
57
58 /**
59 * Returns the (internal) identifier for the object, if it is known to the
60 * backend. Otherwise NULL is returned.
61 *
62 * @param object $object
63 * @return string|null The identifier for the object if it is known, or NULL
64 */
65 public function getIdentifierByObject($object);
66
67 /**
68 * Returns the object with the (internal) identifier, if it is known to the
69 * backend. Otherwise NULL is returned.
70 *
71 * @param string $identifier
72 * @param string $className
73 * @return object|null The object for the identifier if it is known, or NULL
74 */
75 public function getObjectByIdentifier($identifier, $className);
76
77 /**
78 * Checks if the given object has ever been persisted.
79 *
80 * @param object $object The object to check
81 * @return bool TRUE if the object is new, FALSE if the object exists in the repository
82 */
83 public function isNewObject($object);
84
85 /**
86 * Returns the number of records matching the query.
87 *
88 * @param \TYPO3\CMS\Extbase\Persistence\QueryInterface $query
89 * @return int
90 * @api
91 */
92 public function getObjectCountByQuery(\TYPO3\CMS\Extbase\Persistence\QueryInterface $query);
93
94 /**
95 * Returns the object data matching the $query.
96 *
97 * @param \TYPO3\CMS\Extbase\Persistence\QueryInterface $query
98 * @return array
99 * @api
100 */
101 public function getObjectDataByQuery(\TYPO3\CMS\Extbase\Persistence\QueryInterface $query);
102 }