Code Duplication    Length = 19-20 lines in 2 locations

src/DataGrid.php 2 locations

@@ 1806-1824 (lines=19) @@
1803
	 * @param  string $column
1804
	 * @return void
1805
	 */
1806
	public function handleShowColumn($column)
1807
	{
1808
		$columns = $this->getSessionData('_grid_hidden_columns');
1809
1810
		if (!empty($columns)) {
1811
			$pos = array_search($column, $columns);
1812
1813
			if ($pos !== FALSE) {
1814
				unset($columns[$pos]);
1815
			}
1816
		}
1817
1818
		$this->saveSessionData('_grid_hidden_columns', $columns);
1819
		$this->saveSessionData('_grid_hidden_columns_manipulated', TRUE);
1820
1821
		$this->redrawControl();
1822
1823
		$this->onRedraw();
1824
	}
1825
1826
1827
	/**
@@ 1832-1851 (lines=20) @@
1829
	 * @param  string $column
1830
	 * @return void
1831
	 */
1832
	public function handleHideColumn($column)
1833
	{
1834
		/**
1835
		 * Store info about hiding a column to session
1836
		 */
1837
		$columns = $this->getSessionData('_grid_hidden_columns');
1838
1839
		if (empty($columns)) {
1840
			$columns = [$column];
1841
		} else if (!in_array($column, $columns)) {
1842
			array_push($columns, $column);
1843
		}
1844
1845
		$this->saveSessionData('_grid_hidden_columns', $columns);
1846
		$this->saveSessionData('_grid_hidden_columns_manipulated', TRUE);
1847
1848
		$this->redrawControl();
1849
1850
		$this->onRedraw();
1851
	}
1852
1853
1854
	public function handleActionCallback($__key, $__id)