f69ee9b1aa6cecf0fb5aa4e209fa17c544d79f92
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Classes / Persistence / Generic / IdentityMap.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 * An identity mapper to map nodes to objects
19 *
20 * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
21 * @see \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper
22 * @see \TYPO3\CMS\Extbase\Persistence\Generic\Backend
23 * @deprecated since 6.1, will be removed two versions later, use the persistence session instead
24 */
25 class IdentityMap implements \TYPO3\CMS\Core\SingletonInterface {
26
27 /**
28 * @var \TYPO3\CMS\Extbase\Persistence\Generic\Session
29 * @inject
30 */
31 protected $persistenceSession;
32
33 /**
34 * Checks whether the given object is known to the identity map
35 *
36 * @param object $object
37 * @return bool
38 * @deprecated since 6.1, will be removed two versions later, use the persistence session instead
39 */
40 public function hasObject($object) {
41 return $this->persistenceSession->hasObject($object);
42 }
43
44 /**
45 * Checks whether the given UUID is known to the identity map
46 *
47 * @param string $uuid
48 * @param string $className
49 * @return bool
50 * @deprecated since 6.1, will be removed two versions later, use the persistence session instead
51 */
52 public function hasIdentifier($uuid, $className) {
53 return $this->persistenceSession->hasIdentifier($uuid, $className);
54 }
55
56 /**
57 * Returns the object for the given UUID
58 *
59 * @param string $uuid
60 * @param string $className
61 * @return object
62 * @deprecated since 6.1, will be removed two versions later, use the persistence session instead
63 */
64 public function getObjectByIdentifier($uuid, $className) {
65 return $this->persistenceSession->getObjectByIdentifier($uuid, $className);
66 }
67
68 /**
69 * Returns the node identifier for the given object
70 *
71 * @param object $object
72 * @throws \InvalidArgumentException
73 * @throws \TYPO3\CMS\Extbase\Persistence\Exception\UnknownObjectException
74 * @return string
75 * @deprecated since 6.1, will be removed two versions later, use the persistence session instead
76 */
77 public function getIdentifierByObject($object) {
78 return $this->persistenceSession->getIdentifierByObject($object);
79 }
80
81 /**
82 * Register a node identifier for an object
83 *
84 * @param object $object
85 * @param string $uuid
86 * @deprecated since 6.1, will be removed two versions later, use the persistence session instead
87 */
88 public function registerObject($object, $uuid) {
89 $this->persistenceSession->registerObject($object, $uuid);
90 }
91
92 /**
93 * Unregister an object
94 *
95 * @param object $object
96 * @return void
97 * @deprecated since 6.1, will be removed two versions later, use the persistence session instead
98 */
99 public function unregisterObject($object) {
100 $this->persistenceSession->unregisterObject($object);
101 }
102
103 }