getEntityName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
nc 1
nop 0
1
<?php
2
/**
3
 * integer_net Magento Module
4
 *
5
 * @category   IntegerNet
6
 * @package    IntegerNet_Anonymizer
7
 * @copyright  Copyright (c) 2015 integer_net GmbH (http://www.integer-net.de/)
8
 * @author     Fabian Schmengler <[email protected]>
9
 */
10
class IntegerNet_Anonymizer_Model_Bridge_Entity_Order extends IntegerNet_Anonymizer_Model_Bridge_Entity_Abstract
11
{
12
    protected $_entityType = 'order';
13
14
    protected $_attributesUsedForIdentifier = array(
15
        'customer_id', 'increment_id'
16
    );
17
18
    protected $_formattersByAttribute = array(
19
        'customer_email'      => 'safeEmail',
20
        'customer_firstname'  => 'firstName',
21
        'customer_lastname'   => 'lastName',
22
        'customer_middlename' => 'firstName',
23
        'customer_prefix'     => 'title',
24
        'customer_suffix'     => 'suffix',
25
        'customer_taxvat'     => 'randomNumber' // 'vat' provider is not implemented for most counries
26
    );
27
    protected $_uniqueAttributes = array(
28
        'customer_email'
29
    );
30
31
    function __construct()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
32
    {
33
        $this->_entity = Mage::getModel('sales/order');
34
    }
35
36
    protected function _setIdentifier()
37
    {
38
        $this->_identifier = $this->_entity->getCustomerId();
39
    }
40
41
    /**
42
     * Returns name of entity as translatable string
43
     *
44
     * @return string
45
     */
46
    function getEntityName()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
47
    {
48
        return 'Order';
49
    }
50
51
}