Code Duplication    Length = 19-20 lines in 2 locations

src/DataGrid.php 2 locations

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