Code Duplication    Length = 19-20 lines in 2 locations

src/DataGrid.php 2 locations

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