Code Duplication    Length = 19-20 lines in 2 locations

src/DataGrid.php 2 locations

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