Code Duplication    Length = 19-20 lines in 2 locations

src/DataGrid.php 2 locations

@@ 2060-2078 (lines=19) @@
2057
	 * @param  string $column
2058
	 * @return void
2059
	 */
2060
	public function handleShowColumn($column)
2061
	{
2062
		$columns = $this->getSessionData('_grid_hidden_columns');
2063
2064
		if (!empty($columns)) {
2065
			$pos = array_search($column, $columns);
2066
2067
			if ($pos !== FALSE) {
2068
				unset($columns[$pos]);
2069
			}
2070
		}
2071
2072
		$this->saveSessionData('_grid_hidden_columns', $columns);
2073
		$this->saveSessionData('_grid_hidden_columns_manipulated', TRUE);
2074
2075
		$this->redrawControl();
2076
2077
		$this->onRedraw();
2078
	}
2079
2080
2081
	/**
@@ 2086-2105 (lines=20) @@
2083
	 * @param  string $column
2084
	 * @return void
2085
	 */
2086
	public function handleHideColumn($column)
2087
	{
2088
		/**
2089
		 * Store info about hiding a column to session
2090
		 */
2091
		$columns = $this->getSessionData('_grid_hidden_columns');
2092
2093
		if (empty($columns)) {
2094
			$columns = [$column];
2095
		} else if (!in_array($column, $columns)) {
2096
			array_push($columns, $column);
2097
		}
2098
2099
		$this->saveSessionData('_grid_hidden_columns', $columns);
2100
		$this->saveSessionData('_grid_hidden_columns_manipulated', TRUE);
2101
2102
		$this->redrawControl();
2103
2104
		$this->onRedraw();
2105
	}
2106
2107
2108
	public function handleActionCallback($__key, $__id)