Code Duplication    Length = 18-19 lines in 2 locations

src/DataGrid.php 2 locations

@@ 1717-1734 (lines=18) @@
1714
	 * @param  string $column
1715
	 * @return void
1716
	 */
1717
	public function handleShowColumn($column)
1718
	{
1719
		$columns = $this->getSessionData('_grid_hidden_columns');
1720
1721
		if (!empty($columns)) {
1722
			$pos = array_search($column, $columns);
1723
1724
			if ($pos !== FALSE) {
1725
				unset($columns[$pos]);
1726
			}
1727
		}
1728
1729
		$this->saveSessionData('_grid_hidden_columns', $columns);
1730
1731
		$this->redrawControl();
1732
1733
		$this->onRedraw();
1734
	}
1735
1736
1737
	/**
@@ 1742-1760 (lines=19) @@
1739
	 * @param  string $column
1740
	 * @return void
1741
	 */
1742
	public function handleHideColumn($column)
1743
	{
1744
		/**
1745
		 * Store info about hiding a column to session
1746
		 */
1747
		$columns = $this->getSessionData('_grid_hidden_columns');
1748
1749
		if (empty($columns)) {
1750
			$columns = [$column];
1751
		} else if (!in_array($column, $columns)) {
1752
			array_push($columns, $column);
1753
		}
1754
1755
		$this->saveSessionData('_grid_hidden_columns', $columns);
1756
1757
		$this->redrawControl();
1758
1759
		$this->onRedraw();
1760
	}
1761
1762
1763
	public function handleActionCallback($__key, $__id)