Code Duplication    Length = 18-19 lines in 2 locations

src/DataGrid.php 2 locations

@@ 1674-1691 (lines=18) @@
1671
	 * @param  string $column
1672
	 * @return void
1673
	 */
1674
	public function handleShowColumn($column)
1675
	{
1676
		$columns = $this->getSessionData('_grid_hidden_columns');
1677
1678
		if (!empty($columns)) {
1679
			$pos = array_search($column, $columns);
1680
1681
			if ($pos !== FALSE) {
1682
				unset($columns[$pos]);
1683
			}
1684
		}
1685
1686
		$this->saveSessionData('_grid_hidden_columns', $columns);
1687
1688
		$this->redrawControl();
1689
1690
		$this->onRedraw();
1691
	}
1692
1693
1694
	/**
@@ 1699-1717 (lines=19) @@
1696
	 * @param  string $column
1697
	 * @return void
1698
	 */
1699
	public function handleHideColumn($column)
1700
	{
1701
		/**
1702
		 * Store info about hiding a column to session
1703
		 */
1704
		$columns = $this->getSessionData('_grid_hidden_columns');
1705
1706
		if (empty($columns)) {
1707
			$columns = [$column];
1708
		} else if (!in_array($column, $columns)) {
1709
			array_push($columns, $column);
1710
		}
1711
1712
		$this->saveSessionData('_grid_hidden_columns', $columns);
1713
1714
		$this->redrawControl();
1715
1716
		$this->onRedraw();
1717
	}
1718
1719
1720
	public function handleActionCallback($__key, $__id)