Code Duplication    Length = 19-20 lines in 2 locations

src/DataGrid.php 2 locations

@@ 1859-1877 (lines=19) @@
1856
	 * @param  string $column
1857
	 * @return void
1858
	 */
1859
	public function handleShowColumn($column)
1860
	{
1861
		$columns = $this->getSessionData('_grid_hidden_columns');
1862
1863
		if (!empty($columns)) {
1864
			$pos = array_search($column, $columns);
1865
1866
			if ($pos !== FALSE) {
1867
				unset($columns[$pos]);
1868
			}
1869
		}
1870
1871
		$this->saveSessionData('_grid_hidden_columns', $columns);
1872
		$this->saveSessionData('_grid_hidden_columns_manipulated', TRUE);
1873
1874
		$this->redrawControl();
1875
1876
		$this->onRedraw();
1877
	}
1878
1879
1880
	/**
@@ 1885-1904 (lines=20) @@
1882
	 * @param  string $column
1883
	 * @return void
1884
	 */
1885
	public function handleHideColumn($column)
1886
	{
1887
		/**
1888
		 * Store info about hiding a column to session
1889
		 */
1890
		$columns = $this->getSessionData('_grid_hidden_columns');
1891
1892
		if (empty($columns)) {
1893
			$columns = [$column];
1894
		} else if (!in_array($column, $columns)) {
1895
			array_push($columns, $column);
1896
		}
1897
1898
		$this->saveSessionData('_grid_hidden_columns', $columns);
1899
		$this->saveSessionData('_grid_hidden_columns_manipulated', TRUE);
1900
1901
		$this->redrawControl();
1902
1903
		$this->onRedraw();
1904
	}
1905
1906
1907
	public function handleActionCallback($__key, $__id)