Code Duplication    Length = 8-9 lines in 4 locations

src/Intraface/shared/email/Email.php 1 location

@@ 257-265 (lines=9) @@
254
     *
255
     * @return boolean
256
     */
257
    function setIsSent()
258
    {
259
        if ($this->id == 0) {
260
            return false;
261
        }
262
        $db = new DB_Sql;
263
        $db->query("UPDATE email SET status = 3, date_sent = NOW() WHERE id = " . $this->id);
264
        return true;
265
    }
266
267
    /**
268
     * Checks if e-mail can be sent

src/Intraface/modules/newsletter/NewsletterSubscriber.php 1 location

@@ 483-490 (lines=8) @@
480
     * Resends the optin e-mail to the user again, and adds one to count of resend times.
481
     *
482
     */
483
    function resendOptInEmail()
484
    {
485
        if ($this->sendOptInEmail()) {
486
            $db = new DB_Sql;
487
            $db->query("UPDATE newsletter_subscriber SET resend_optin_email_count = resend_optin_email_count + 1 WHERE id = " . $this->id);
488
            return true;
489
        }
490
    }
491
492
    private function getLoginUrl($contact)
493
    {

src/Intraface/modules/todo/TodoItem.php 2 locations

@@ 132-140 (lines=9) @@
129
     *
130
     * @return boolean
131
     */
132
    public function setDone()
133
    {
134
        if ($this->id == 0) {
135
            return false;
136
        }
137
        $db = new DB_Sql;
138
        $db->query("UPDATE todo_item SET status = 1 WHERE id = " . $this->id);
139
        return true;
140
    }
141
142
    /**
143
     * Deletes item
@@ 147-155 (lines=9) @@
144
     *
145
     * @return boolean
146
     */
147
    public function delete()
148
    {
149
        if ($this->id <= 0) {
150
            return false;
151
        }
152
        $db = new DB_Sql;
153
        $db->query("UPDATE todo_item SET active = 0 WHERE id = " . $this->id);
154
        return true;
155
    }
156
157
    /**
158
     * Gets position object