Completed
Push — 15.x ( b45baa...4ca9b4 )
by Tim
02:13
created

GenericDynamicIdentifierAction   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 1
1
<?php
2
3
/**
4
 * TechDivision\Import\Actions\GenericDynamicIdentifierAction
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 2019 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
18
 * @link      http://www.techdivision.com
19
 */
20
21
namespace TechDivision\Import\Actions;
22
23
use TechDivision\Import\Utils\PrimaryKeyUtilInterface;
24
use TechDivision\Import\Actions\Processors\ProcessorInterface;
25
26
/**
27
 * An action implementation that provides CRUD functionality and returns the ID of
28
 * the persisted entity for the `update` and `create` methods.
29
 *
30
 * @author    Tim Wagner <[email protected]>
31
 * @copyright 2019 TechDivision GmbH <[email protected]>
32
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
33
 * @link      https://github.com/techdivision/import-category
34
 * @link      http://www.techdivision.com
35
 */
36
class GenericDynamicIdentifierAction extends GenericIdentifierAction
37
{
38
39
    /**
40
     * Initialize the instance with the passed processors.
41
     *
42
     * @param \TechDivision\Import\Utils\PrimaryKeyUtilInterface              $primaryKeyUtil  The primary key utility instance
43
     * @param \TechDivision\Import\Actions\Processors\ProcessorInterface|null $createProcessor The create processor instance
44
     * @param \TechDivision\Import\Actions\Processors\ProcessorInterface|null $updateProcessor The update processor instance
45
     * @param \TechDivision\Import\Actions\Processors\ProcessorInterface|null $deleteProcessor The delete processor instance
46
     */
47
    public function __construct(
48
        PrimaryKeyUtilInterface $primaryKeyUtil,
49
        ProcessorInterface $createProcessor = null,
50
        ProcessorInterface $updateProcessor = null,
51
        ProcessorInterface $deleteProcessor = null
52
    ) {
53
54
        // pass the processor instances and the primary key name to the parent constructor
55
        parent::__construct($createProcessor, $updateProcessor, $deleteProcessor, $primaryKeyUtil->getPrimaryKeyMemberName());
56
    }
57
}
58