protected function onceWithColumns($columns, $callback)
    {
        $original = $this->columns;

        if (is_null($original)) {
            $this->columns = $columns;
        }

        $result = $callback();

        $this->columns = $original;

        return $result;
    }
protected function onceWithColumns($columns, $callback)
    {
        $original = $this->columns;

        if (is_null($original)) {
            $this->columns = $columns;
        }

        $result = $callback();

        $this->columns = $original;

        return $result;
    }
protected function onceWithColumns ( $ columns , $ callback ) { $ original = $ this -> columns ; if ( is_null ( $ original ) ) { $ this -> columns = $ columns ; } $ result = $ callback ( ) ; $ this -> columns = $ original ; return $ result ; }
Execute the given callback while selecting the given columns.

After running the callback, the columns are reset to the original value.

@param  array  $columns
@param  callable  $callback
@return mixed
Execute the given callback while selecting the given columns .