Code Duplication    Length = 19-20 lines in 2 locations

src/DataGrid.php 2 locations

@@ 2132-2150 (lines=19) @@
2129
	 * @param  string $column
2130
	 * @return void
2131
	 */
2132
	public function handleShowColumn($column)
2133
	{
2134
		$columns = $this->getSessionData('_grid_hidden_columns');
2135
2136
		if (!empty($columns)) {
2137
			$pos = array_search($column, $columns);
2138
2139
			if ($pos !== FALSE) {
2140
				unset($columns[$pos]);
2141
			}
2142
		}
2143
2144
		$this->saveSessionData('_grid_hidden_columns', $columns);
2145
		$this->saveSessionData('_grid_hidden_columns_manipulated', TRUE);
2146
2147
		$this->redrawControl();
2148
2149
		$this->onRedraw();
2150
	}
2151
2152
2153
	/**
@@ 2158-2177 (lines=20) @@
2155
	 * @param  string $column
2156
	 * @return void
2157
	 */
2158
	public function handleHideColumn($column)
2159
	{
2160
		/**
2161
		 * Store info about hiding a column to session
2162
		 */
2163
		$columns = $this->getSessionData('_grid_hidden_columns');
2164
2165
		if (empty($columns)) {
2166
			$columns = [$column];
2167
		} else if (!in_array($column, $columns)) {
2168
			array_push($columns, $column);
2169
		}
2170
2171
		$this->saveSessionData('_grid_hidden_columns', $columns);
2172
		$this->saveSessionData('_grid_hidden_columns_manipulated', TRUE);
2173
2174
		$this->redrawControl();
2175
2176
		$this->onRedraw();
2177
	}
2178
2179
2180
	public function handleActionCallback($__key, $__id)