Code Duplication    Length = 19-20 lines in 2 locations

src/DataGrid.php 2 locations

@@ 1985-2003 (lines=19) @@
1982
	 * @param  string $column
1983
	 * @return void
1984
	 */
1985
	public function handleShowColumn($column)
1986
	{
1987
		$columns = $this->getSessionData('_grid_hidden_columns');
1988
1989
		if (!empty($columns)) {
1990
			$pos = array_search($column, $columns);
1991
1992
			if ($pos !== FALSE) {
1993
				unset($columns[$pos]);
1994
			}
1995
		}
1996
1997
		$this->saveSessionData('_grid_hidden_columns', $columns);
1998
		$this->saveSessionData('_grid_hidden_columns_manipulated', TRUE);
1999
2000
		$this->redrawControl();
2001
2002
		$this->onRedraw();
2003
	}
2004
2005
2006
	/**
@@ 2011-2030 (lines=20) @@
2008
	 * @param  string $column
2009
	 * @return void
2010
	 */
2011
	public function handleHideColumn($column)
2012
	{
2013
		/**
2014
		 * Store info about hiding a column to session
2015
		 */
2016
		$columns = $this->getSessionData('_grid_hidden_columns');
2017
2018
		if (empty($columns)) {
2019
			$columns = [$column];
2020
		} else if (!in_array($column, $columns)) {
2021
			array_push($columns, $column);
2022
		}
2023
2024
		$this->saveSessionData('_grid_hidden_columns', $columns);
2025
		$this->saveSessionData('_grid_hidden_columns_manipulated', TRUE);
2026
2027
		$this->redrawControl();
2028
2029
		$this->onRedraw();
2030
	}
2031
2032
2033
	public function handleActionCallback($__key, $__id)