Code Duplication    Length = 14-14 lines in 2 locations

code/model/FacebookIdentifier.php 1 location

@@ 82-95 (lines=14) @@
79
        return "";
80
    }
81
82
    public function onBeforeWrite()
83
    {
84
        if (!$this->owner->Email) {
85
            if ($this->owner->FacebookEmail) {
86
                $id = $this->owner->ID;
87
                if (!$id) {
88
                    $id = 0;
89
                }
90
                if (!DataObject::get_one("Member", "\"Email\" = '".$this->owner->FacebookEmail."' AND \"Member\".\"ID\" <> ".$id."")) {
91
                    $this->owner->Email = $this->owner->FacebookEmail;
92
                }
93
            }
94
        }
95
    }
96
}
97

code/model/LinkedinIdentifier.php 1 location

@@ 64-77 (lines=14) @@
61
        return "";
62
    }
63
64
    public function onBeforeWrite()
65
    {
66
        if (!$this->owner->Email) {
67
            if ($this->owner->LinkedinEmail) {
68
                $id = $this->owner->ID;
69
                if (!$id) {
70
                    $id = 0;
71
                }
72
                if (!DataObject::get_one("Member", "\"Email\" = '".$this->owner->LinkedinEmail."' AND \"Member\".\"ID\" <> ".$id."")) {
73
                    $this->owner->Email = $this->owner->LinkedinEmail;
74
                }
75
            }
76
        }
77
    }
78
}
79