public function addColumn(Column $column, $position = 0)
    {
        $column->setAuthorizationChecker($this->authorizationChecker);

        if ($position == 0) {
            $this->columns[] = $column;
        } else {
            if ($position > 0) {
                --$position;
            } else {
                $position = max(0, count($this->columns) + $position);
            }

            $head = array_slice($this->columns, 0, $position);
            $tail = array_slice($this->columns, $position);
            $this->columns = array_merge($head, [$column], $tail);
        }

        return $this;
    }
public function addColumn(Column $column, $position = 0)
    {
        $column->setAuthorizationChecker($this->authorizationChecker);

        if ($position == 0) {
            $this->columns[] = $column;
        } else {
            if ($position > 0) {
                --$position;
            } else {
                $position = max(0, count($this->columns) + $position);
            }

            $head = array_slice($this->columns, 0, $position);
            $tail = array_slice($this->columns, $position);
            $this->columns = array_merge($head, [$column], $tail);
        }

        return $this;
    }
public function addColumn ( Column $ column , $ position = 0 ) { $ column -> setAuthorizationChecker ( $ this -> authorizationChecker ) ; if ( $ position == 0 ) { $ this -> columns [ ] = $ column ; } else { if ( $ position > 0 ) { -- $ position ; } else { $ position = max ( 0 , count ( $ this -> columns ) + $ position ) ; } $ head = array_slice ( $ this -> columns , 0 , $ position ) ; $ tail = array_slice ( $ this -> columns , $ position ) ; $ this -> columns = array_merge ( $ head , [ $ column ] , $ tail ) ; } return $ this ; }
Add column.

@param Column $column
@param int    $position

@return Columns
Add column .