Code Duplication    Length = 19-20 lines in 2 locations

src/DataGrid.php 2 locations

@@ 2183-2201 (lines=19) @@
2180
	 * @param  string $column
2181
	 * @return void
2182
	 */
2183
	public function handleShowColumn($column)
2184
	{
2185
		$columns = $this->getSessionData('_grid_hidden_columns');
2186
2187
		if (!empty($columns)) {
2188
			$pos = array_search($column, $columns);
2189
2190
			if ($pos !== FALSE) {
2191
				unset($columns[$pos]);
2192
			}
2193
		}
2194
2195
		$this->saveSessionData('_grid_hidden_columns', $columns);
2196
		$this->saveSessionData('_grid_hidden_columns_manipulated', TRUE);
2197
2198
		$this->redrawControl();
2199
2200
		$this->onRedraw();
2201
	}
2202
2203
2204
	/**
@@ 2209-2228 (lines=20) @@
2206
	 * @param  string $column
2207
	 * @return void
2208
	 */
2209
	public function handleHideColumn($column)
2210
	{
2211
		/**
2212
		 * Store info about hiding a column to session
2213
		 */
2214
		$columns = $this->getSessionData('_grid_hidden_columns');
2215
2216
		if (empty($columns)) {
2217
			$columns = [$column];
2218
		} else if (!in_array($column, $columns)) {
2219
			array_push($columns, $column);
2220
		}
2221
2222
		$this->saveSessionData('_grid_hidden_columns', $columns);
2223
		$this->saveSessionData('_grid_hidden_columns_manipulated', TRUE);
2224
2225
		$this->redrawControl();
2226
2227
		$this->onRedraw();
2228
	}
2229
2230
2231
	public function handleActionCallback($__key, $__id)