ExcludeIdentityMapDataMapper   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 3
dl 0
loc 22
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A mapSingleRow() 0 11 1
1
<?php
2
3
/**
4
 * Exclude the IdentityMap in the regular data map for backend selection
5
 * We need on object in different languages and the IdentityMap do not respect that!
6
 */
7
declare(strict_types = 1);
8
9
namespace HDNET\Autoloader\Persistence;
10
11
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
12
use TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper;
13
14
/**
15
 * Exclude the IdentityMap in the regular data map for backend selection
16
 * We need on object in different languages and the IdentityMap do not respect that!
17
 */
18
class ExcludeIdentityMapDataMapper extends DataMapper
19
{
20
    /**
21
     * Maps a single row on an object of the given class.
22
     *
23
     * @param string $className The name of the target class
24
     * @param array  $row       A single array with field_name => value pairs
25
     *
26
     * @return object An object of the given class
27
     */
28
    protected function mapSingleRow($className, array $row)
29
    {
30
        /** @var AbstractEntity $object */
31
        $object = $this->createEmptyObject($className);
32
        $this->persistenceSession->registerObject($object, $row['uid']);
33
        $this->thawProperties($object, $row);
34
        $object->_memorizeCleanState();
35
        $this->persistenceSession->registerReconstitutedEntity($object);
36
37
        return $object;
38
    }
39
}
40