NewsletterSubscriber::_setIdentifier()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
nc 2
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_NewsletterSubscriber
11
    extends IntegerNet_Anonymizer_Model_Bridge_Entity_Abstract
12
{
13
14
    protected $_attributesUsedForIdentifier = array(
15
        'customer_id'
16
    );
17
    protected $_formattersByAttribute = array(
18
        'subscriber_email' => 'safeEmail',
19
    );
20
21
    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...
22
    {
23
        $this->_entity = Mage::getModel('newsletter/subscriber');
24
    }
25
26
    /**
27
     * Sets identifier based on current entity
28
     *
29
     * @return void
30
     */
31
    protected function _setIdentifier()
32
    {
33
        $this->_identifier = $this->_entity->getCustomerId() ?: $this->_entity->getEmail();
34
    }
35
36
    /**
37
     * Returns name of entity as translatable string
38
     *
39
     * @return string
40
     */
41
    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...
42
    {
43
        return 'Newsletter Subscriber';
44
    }
45
46
47
}