Code Duplication    Length = 19-20 lines in 2 locations

src/DataGrid.php 2 locations

@@ 1739-1757 (lines=19) @@
1736
	 * @param  string $column
1737
	 * @return void
1738
	 */
1739
	public function handleShowColumn($column)
1740
	{
1741
		$columns = $this->getSessionData('_grid_hidden_columns');
1742
1743
		if (!empty($columns)) {
1744
			$pos = array_search($column, $columns);
1745
1746
			if ($pos !== FALSE) {
1747
				unset($columns[$pos]);
1748
			}
1749
		}
1750
1751
		$this->saveSessionData('_grid_hidden_columns', $columns);
1752
		$this->saveSessionData('_grid_hidden_columns_manipulated', TRUE);
1753
1754
		$this->redrawControl();
1755
1756
		$this->onRedraw();
1757
	}
1758
1759
1760
	/**
@@ 1765-1784 (lines=20) @@
1762
	 * @param  string $column
1763
	 * @return void
1764
	 */
1765
	public function handleHideColumn($column)
1766
	{
1767
		/**
1768
		 * Store info about hiding a column to session
1769
		 */
1770
		$columns = $this->getSessionData('_grid_hidden_columns');
1771
1772
		if (empty($columns)) {
1773
			$columns = [$column];
1774
		} else if (!in_array($column, $columns)) {
1775
			array_push($columns, $column);
1776
		}
1777
1778
		$this->saveSessionData('_grid_hidden_columns', $columns);
1779
		$this->saveSessionData('_grid_hidden_columns_manipulated', TRUE);
1780
1781
		$this->redrawControl();
1782
1783
		$this->onRedraw();
1784
	}
1785
1786
1787
	public function handleActionCallback($__key, $__id)