Code Duplication    Length = 10-12 lines in 2 locations

models/ConversationEvent.php 1 location

@@ 78-87 (lines=10) @@
75
     * @param  string     $status    The status of the event, can be 'visible', 'hidden', 'deleted' or 'reported'
76
     * @return ConversationEvent
77
     */
78
    public static function storeEvent($conversation, $event, $type, $timestamp = 'now', $status = 'visible')
79
    {
80
        return self::create(array(
81
            "conversation_to" => $conversation,
82
            "message"         => serialize($event),
83
            "event_type"      => $type,
84
            "timestamp"       => TimeDate::from($timestamp)->toMysql(),
85
            "status"          => $status
86
        ));
87
    }
88
89
    /**
90
     * Get a query builder for events

models/Notification.php 1 location

@@ 77-88 (lines=12) @@
74
     * @param  string       $status    The status of the notification (unread, read, deleted)
75
     * @return Notification An object representing the notification that was just entered
76
     */
77
    public static function newNotification($receiver, $type, $event, $timestamp = "now", $status = "unread")
78
    {
79
        $notification = self::create(array(
80
            "receiver"  => $receiver,
81
            "type"      => $type,
82
            "event"     => serialize($event),
83
            "timestamp" => TimeDate::from($timestamp)->toMysql(),
84
            "status"    => $status
85
        ));
86
87
        return $notification;
88
    }
89
90
    /**
91
     * Show a list of notifications for a specific user