Code Duplication    Length = 19-20 lines in 2 locations

src/DataGrid.php 2 locations

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