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

By default it is in SELECT mode

@param string $mode A key for $this->sql_templates

@return $this
191454
public function SQLTemplate($mode)
    {
        $this->mode = $mode;
        $this->template = $this->sql_templates[$mode];

        return $this;
    }
742531
public function setFetchMode($mode)
    {
        switch ($mode) {
            case Zend_Db::FETCH_LAZY:
            case Zend_Db::FETCH_ASSOC:
            case Zend_Db::FETCH_NUM:
            case Zend_Db::FETCH_BOTH:
            case Zend_Db::FETCH_NAMED:
            case Zend_Db::FETCH_OBJ:
                $this->_fetchMode = $mode;
                break;
            case Zend_Db::FETCH_BOUND: // bound to PHP variable
                /**
                 * @see Zend_Db_Adapter_Mysqli_Exception
                 */
                // require_once 'Zend/Db/Adapter/Mysqli/Exception.php';
                throw new Zend_Db_Adapter_Mysqli_Exception('FETCH_BOUND is not supported yet');
                break;
            default:
                /**
                 * @see Zend_Db_Adapter_Mysqli_Exception
                 */
                // require_once 'Zend/Db/Adapter/Mysqli/Exception.php';
                throw new Zend_Db_Adapter_Mysqli_Exception("Invalid fetch mode '$mode' specified");
        }
    }
548751
public function setTemplate(string $template): self
    {
        $this->template = $template;
        $this->logger->debug("Template file set to loader.", ["template" => $this->template]);
        return $this;
    }
1034283
public function setMode($mode)
    {
        $this->mode = (null === $mode ? null : (bool) $mode);
        return $this;
    }
991062
public static function setMode($mode = '')
    {
        static::$MODE = 0;
        if (empty($mode)) {
            return;
        }
        $mode = explode(',', $mode);
        foreach ($mode as $m) {
            static::$MODE |= constant('static::SQL_MODE_' . $m);
        }
    }
189484
public function inMode( $mode )
	{
		if ( !is_array($mode) )
		{
			$mode = func_get_args();
		}

		return in_array( $this->reset_mode, $mode );
	}
354369
protected function loadTemplate(string $mode)
    {
        if ($mode == 'create') { // create mode
            $tplPath = sprintf(MODULE_VIEWS, $this->module . '/' . $this->division);
            $tplName = $tplPath . 'edit.php';
            $this->template->load($tplName);
        }
    }
648457
public function setMode($mode)
    {
        Validate::isString($mode, 'mode');
        Validate::isTrue(Mode::isValid($mode), Resources::INVALID_CHANGE_MODE_MSG);

        $this->_mode = $mode;
    }
568451
public function setMode($mode) {
		$editMode = ($mode=="on")?true:false;
		//SessionUtils::setMessageEditionMode($editMode);
		if ($editMode) {
			$_SESSION["FINE_MESSAGE_EDITION_MODE"] = true;
			$this->isMessageEditionMode = true;
		} else {
			unset($_SESSION["FINE_MESSAGE_EDITION_MODE"]);
		}

		$this->content->addFile('../utils.i18n.fine/src/views/enableDisableEdition.php', $this);
		$this->template->toHtml();
	}
762946
public function setResultMode($mode)
    {
        if( !is_int($mode) || $mode < 0 || $mode > 3 ) {
            throw new InvalidArgumentException("Invalid result mode");
        }
        $this->resultMode = $mode;
        return $this;
    }
894588
public function getMainPageById($id, $mode = AbstractQuery::HYDRATE_ARRAY)
    {
        $qb = $this->getEntityManager()->createQueryBuilder();
        $qb->select('e.id, t.layout', 'p.id as parentId', 't.id as templateId')
            ->from($this->getEntity(), 'e')
            ->leftJoin('e.template', 't')
            ->leftJoin('e.parent', 'p')
            ->where('e.id = :id')
            ->setParameters(
                [
                    ':id' => $id,
                ]
            );

        $qb->setEnableHydrationCache($this->enableResultCache);
        $result = $qb->getQuery()->getOneOrNullResult($mode);

        return $result;
    }
859990
public function setCursorMode($mode) {
        switch($mode) {
            case DB::CURSOR_FIRST:
            case DB::CURSOR_PREV:
            case DB::CURSOR_NEXT:
            case DB::CURSOR_LAST:
                $this->cursorMode = $mode;
                break;
            default:
                throw new \InvalidArgumentException('Invalid cursor mode');
        }
    }
941369
public function setFetchMode($mode)
    {
        switch ($mode) {
            case Zend_Db::FETCH_NUM:   // seq array
            case Zend_Db::FETCH_ASSOC: // assoc array
            case Zend_Db::FETCH_BOTH:  // seq+assoc array
            case Zend_Db::FETCH_OBJ:   // object
                $this->_fetchMode = $mode;
                break;
            case Zend_Db::FETCH_BOUND:   // bound to PHP variable
                /**
                 * @see Zend_Db_Adapter_Db2_Exception
                 */
                // require_once 'Zend/Db/Adapter/Db2/Exception.php';
                throw new Zend_Db_Adapter_Db2_Exception('FETCH_BOUND is not supported yet');
                break;
            default:
                /**
                 * @see Zend_Db_Adapter_Db2_Exception
                 */
                // require_once 'Zend/Db/Adapter/Db2/Exception.php';
                throw new Zend_Db_Adapter_Db2_Exception("Invalid fetch mode '$mode' specified");
                break;
        }
    }
693248
public function switchAndSave( $mode ) {
		$this->originalMode = $this->mode;
		$this->mode = $mode;
		$this->handler = $this->dispatchTable[$mode];
		return $this->handler;
	}
772960
public function matchMode($mode)
    {
        if (!self::validMatchMode($mode)) {
            throw new WURFL_WURFLException('Invalid Match Mode: '.$mode);
        }
        $this->matchMode = $mode;
        return $this;
    }
1361495
protected function view_switcher($current_mode)
    {
        $modes = array(
            'list'    => __('List View'),
            'excerpt' => __('Excerpt View')
        );

?>
        <input type="hidden" name="mode" value="<?php echo esc_attr( $current_mode ); ?>" />
        <div class="view-switch">
<?php
            foreach ( $modes as $mode => $title ) {
                $class = ( $current_mode == $mode ) ? 'class="current"' : '';
                echo "<a href='" . esc_url( add_query_arg( 'mode', $mode, $_SERVER['REQUEST_URI'] ) ) . "' $class><img id='view-switch-$mode' src='" . esc_url( includes_url( 'images/blank.gif' ) ) . "' width='20' height='20' title='$title' alt='$title' /></a>\n";
            }
        ?>
        </div>
<?php
    }
1182771
public function debugMode($mode)
    {
        if (!isset($this->debugMode[$mode])) {
            $mode = 'production';
        }

        $this->mail->SMTPDebug = $this->debugMode[$mode];
        $this->mail->Debugoutput = function ($str, $mode) {
            logger(LogLevel::DEBUG, $str, ['debugMode' => $mode]);
        };

        return $this;
    }