Code Duplication    Length = 19-20 lines in 2 locations

src/DataGrid.php 2 locations

@@ 2213-2231 (lines=19) @@
2210
	 * @param  string $column
2211
	 * @return void
2212
	 */
2213
	public function handleShowColumn($column)
2214
	{
2215
		$columns = $this->getSessionData('_grid_hidden_columns');
2216
2217
		if (!empty($columns)) {
2218
			$pos = array_search($column, $columns);
2219
2220
			if ($pos !== FALSE) {
2221
				unset($columns[$pos]);
2222
			}
2223
		}
2224
2225
		$this->saveSessionData('_grid_hidden_columns', $columns);
2226
		$this->saveSessionData('_grid_hidden_columns_manipulated', TRUE);
2227
2228
		$this->redrawControl();
2229
2230
		$this->onRedraw();
2231
	}
2232
2233
2234
	/**
@@ 2239-2258 (lines=20) @@
2236
	 * @param  string $column
2237
	 * @return void
2238
	 */
2239
	public function handleHideColumn($column)
2240
	{
2241
		/**
2242
		 * Store info about hiding a column to session
2243
		 */
2244
		$columns = $this->getSessionData('_grid_hidden_columns');
2245
2246
		if (empty($columns)) {
2247
			$columns = [$column];
2248
		} else if (!in_array($column, $columns)) {
2249
			array_push($columns, $column);
2250
		}
2251
2252
		$this->saveSessionData('_grid_hidden_columns', $columns);
2253
		$this->saveSessionData('_grid_hidden_columns_manipulated', TRUE);
2254
2255
		$this->redrawControl();
2256
2257
		$this->onRedraw();
2258
	}
2259
2260
2261
	public function handleActionCallback($__key, $__id)