Code Duplication    Length = 13-13 lines in 2 locations

src/Models/EmailsTable/EmailTrait.php 2 locations

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