754086438b21460f10e64c1769099cbf95498fdb
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Classes / Persistence / PersistenceManagerInterface.php
1 <?php
2 namespace TYPO3\CMS\Extbase\Persistence;
3
4 /* *
5 * This script belongs to the Extbase framework. *
6 * *
7 * This class is a backport of the corresponding class of FLOW3. *
8 * All credits go to the v5 team. *
9 * *
10 * It is free software; you can redistribute it and/or modify it under *
11 * the terms of the GNU Lesser General Public License, either version 3 *
12 * of the License, or (at your option) any later version. *
13 * *
14 * The TYPO3 project - inspiring people to share! *
15 * */
16 /**
17 * The Extbase Persistence Manager interface
18 */
19 interface PersistenceManagerInterface
20 {
21 /**
22 * Commits new objects and changes to objects in the current persistence
23 * session into the backend
24 *
25 * @return void
26 * @api
27 */
28 public function persistAll();
29
30 /**
31 * Returns the (internal) identifier for the object, if it is known to the
32 * backend. Otherwise NULL is returned.
33 *
34 * Note: this returns an identifier even if the object has not been
35 * persisted in case of AOP-managed entities. Use isNewObject() if you need
36 * to distinguish those cases.
37 *
38 * @param object $object
39 * @return mixed The identifier for the object if it is known, or NULL
40 * @api
41 */
42 public function getIdentifierByObject($object);
43
44 /**
45 * Returns the object with the (internal) identifier, if it is known to the
46 * backend. Otherwise NULL is returned.
47 *
48 * @param mixed $identifier
49 * @param string $objectType
50 * @return object The object for the identifier if it is known, or NULL
51 * @api
52 */
53 public function getObjectByIdentifier($identifier, $objectType);
54
55 /**
56 * Returns the number of records matching the query.
57 *
58 * @param \TYPO3\CMS\Extbase\Persistence\QueryInterface $query
59 * @return integer
60 * @api
61 */
62 public function getObjectCountByQuery(\TYPO3\CMS\Extbase\Persistence\QueryInterface $query);
63
64 /**
65 * Returns the object data matching the $query.
66 *
67 * @param \TYPO3\CMS\Extbase\Persistence\QueryInterface $query
68 * @return array
69 * @api
70 */
71 public function getObjectDataByQuery(\TYPO3\CMS\Extbase\Persistence\QueryInterface $query);
72
73 /**
74 * Registers a repository
75 *
76 * @param string $className The class name of the repository to be reigistered
77 * @return void
78 */
79 public function registerRepositoryClassName($className);
80
81 }
82
83 ?>