Code Duplication    Length = 19-20 lines in 2 locations

src/DataGrid.php 2 locations

@@ 2145-2163 (lines=19) @@
2142
	 * @param  string $column
2143
	 * @return void
2144
	 */
2145
	public function handleShowColumn($column)
2146
	{
2147
		$columns = $this->getSessionData('_grid_hidden_columns');
2148
2149
		if (!empty($columns)) {
2150
			$pos = array_search($column, $columns);
2151
2152
			if ($pos !== FALSE) {
2153
				unset($columns[$pos]);
2154
			}
2155
		}
2156
2157
		$this->saveSessionData('_grid_hidden_columns', $columns);
2158
		$this->saveSessionData('_grid_hidden_columns_manipulated', TRUE);
2159
2160
		$this->redrawControl();
2161
2162
		$this->onRedraw();
2163
	}
2164
2165
2166
	/**
@@ 2171-2190 (lines=20) @@
2168
	 * @param  string $column
2169
	 * @return void
2170
	 */
2171
	public function handleHideColumn($column)
2172
	{
2173
		/**
2174
		 * Store info about hiding a column to session
2175
		 */
2176
		$columns = $this->getSessionData('_grid_hidden_columns');
2177
2178
		if (empty($columns)) {
2179
			$columns = [$column];
2180
		} else if (!in_array($column, $columns)) {
2181
			array_push($columns, $column);
2182
		}
2183
2184
		$this->saveSessionData('_grid_hidden_columns', $columns);
2185
		$this->saveSessionData('_grid_hidden_columns_manipulated', TRUE);
2186
2187
		$this->redrawControl();
2188
2189
		$this->onRedraw();
2190
	}
2191
2192
2193
	public function handleActionCallback($__key, $__id)