Code Duplication    Length = 12-12 lines in 2 locations

classes/models/FrmInbox.php 2 locations

@@ 132-143 (lines=12) @@
129
	/**
130
	 * @param string $key
131
	 */
132
	public function mark_read( $key ) {
133
		if ( ! isset( $this->messages[ $key ] ) ) {
134
			return;
135
		}
136
137
		if ( ! isset( $this->messages[ $key ]['read'] ) ) {
138
			$this->messages[ $key ]['read'] = array();
139
		}
140
		$this->messages[ $key ]['read'][ get_current_user_id() ] = time();
141
142
		$this->update_list();
143
	}
144
145
	/**
146
	 * @param string $key
@@ 161-172 (lines=12) @@
158
	/**
159
	 * @param string $key
160
	 */
161
	public function dismiss( $key ) {
162
		if ( ! isset( $this->messages[ $key ] ) ) {
163
			return;
164
		}
165
166
		if ( ! isset( $this->messages[ $key ]['dismissed'] ) ) {
167
			$this->messages[ $key ]['dismissed'] = array();
168
		}
169
		$this->messages[ $key ]['dismissed'][ get_current_user_id() ] = time();
170
171
		$this->update_list();
172
	}
173
174
	public function unread() {
175
		$messages = $this->get_messages();