Completed
Push — master ( 802965...2aeb66 )
by Tim
01:24
created

EeClearUrlRewriteObserver   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 17
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A mapPath() 0 4 1
1
<?php
2
3
/**
4
 * TechDivision\Import\Category\Ee\Observers\EeClearUrlRewriteObserver
5
 *
6
 * NOTICE OF LICENSE
7
 *
8
 * This source file is subject to the Open Software License (OSL 3.0)
9
 * that is available through the world-wide-web at this URL:
10
 * http://opensource.org/licenses/osl-3.0.php
11
 *
12
 * PHP version 5
13
 *
14
 * @author    Tim Wagner <[email protected]>
15
 * @copyright 2021 TechDivision GmbH <[email protected]>
16
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
 * @link      https://github.com/techdivision/import-category-ee
18
 * @link      http://www.techdivision.com
19
 */
20
21
namespace TechDivision\Import\Category\Ee\Observers;
22
23
use TechDivision\Import\Category\Observers\ClearUrlRewriteObserver;
24
25
/**
26
 * Observer that removes the URL rewrite for the category with the path found in the CSV file.
27
 *
28
 * @author    Tim Wagner <[email protected]>
29
 * @copyright 2021 TechDivision GmbH <[email protected]>
30
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
31
 * @link      https://github.com/techdivision/import-category-ee
32
 * @link      http://www.techdivision.com
33
 */
34
class EeClearUrlRewriteObserver extends ClearUrlRewriteObserver
35
{
36
37
38
    /**
39
     * Return's the entity ID for the passed path.
40
     *
41
     * @param string $path The path to return the entity ID for
42
     *
43
     * @return integer The mapped entity ID
44
     * @throws \Exception Is thrown, if the path can not be mapped
45
     */
46
    protected function mapPath($path)
47
    {
48
        return $this->getSubject()->mapPathRowId($path);
49
    }
50
}
51