Code Duplication    Length = 13-13 lines in 2 locations

src/Models/EmailsTable/EmailTrait.php 2 locations

@@ 178-190 (lines=13) @@
175
    /**
176
     * @return mixed
177
     */
178
    public function getActivitiesByEmail()
179
    {
180
        if (!$this->getRegistry()->exists('activities-email')) {
181
            $actEmail = [];
182
            $activities = $this->getActivities();
183
            foreach ($activities as $activity) {
184
                $actEmail[$activity->email][] = $activity;
185
            }
186
            $this->getRegistry()->set('activities-email', $actEmail);
187
        }
188
189
        return $this->getRegistry()->get('activities-email');
190
    }
191
192
    /**
193
     * @return mixed
@@ 195-207 (lines=13) @@
192
    /**
193
     * @return mixed
194
     */
195
    public function getLinksByEmail()
196
    {
197
        if (!$this->getRegistry()->exists('links-email')) {
198
            $linksEmail = [];
199
            $links = $this->getLinks();
200
            foreach ($links as $link) {
201
                $actEmail[$link->url][$link->email] = $link;
202
            }
203
            $this->getRegistry()->set('links-email', $actEmail);
204
        }
205
206
        return $this->getRegistry()->get('links-email');
207
    }
208
209
    /**
210
     * @param Mailer $mailer