public function mode($mode)
    {
        $prop = 'template_'.$mode;

        if (isset($this->{$prop})) {
            $this->mode = $mode;
            $this->template = $this->{$prop};
        } else {
            throw new Exception([
                'Query does not have this mode',
                'mode' => $mode,
            ]);
        }

        return $this;
    }
public function mode($mode)
    {
        $prop = 'template_'.$mode;

        if (isset($this->{$prop})) {
            $this->mode = $mode;
            $this->template = $this->{$prop};
        } else {
            throw new Exception([
                'Query does not have this mode',
                'mode' => $mode,
            ]);
        }

        return $this;
    }
public function mode ( $ mode ) { $ prop = 'template_' . $ mode ; if ( isset ( $ this -> { $ prop } ) ) { $ this -> mode = $ mode ; $ this -> template = $ this -> { $ prop } ; } else { throw new Exception ( [ 'Query does not have this mode' , 'mode' => $ mode , ] ) ; } return $ this ; }
Switch template for this query. Determines what would be done
on execute.

By default it is in SELECT mode

@param string $mode

@return $this
Switch template for this query . Determines what would be done on execute .