Sets the buttonmode

@param string $mode

@throws InvalidArgumentException

@return UiButton
2707
public function setMode($mode)
    {
        $modelist = [
            'ajax',
            'full'
        ];

        if (!in_array($mode, $modelist)) {
            Throw new ControlException('Wrong mode for UiButton.', 1000);
        }

        $this->mode = $mode;

        return $this;
    }
292394
public function setIterationMode($mode) {
		switch ($mode) {
			case self::ITERATION_STRAIGHT:
				$this->_map = array_keys($this->_data);
				break;
			
			case self::ITERATION_REVERSE:
				$this->_map = array_reverse(array_keys($this->_data));
				break;
			
			case self::ITERATION_EVEN:
				$this->_map = [];
				
				foreach (array_keys($this->_data) as $key => $value) {
					if ($key % 2 === 0) {
						$this->_map[] = $value;
					}
				}
				break;
				
			case self::ITERATION_ODD:
				$this->_map = [];
				
				foreach (array_keys($this->_data) as $key => $value) {
					if ($key % 2 !== 0) {
						$this->_map[] = $value;
					}
				}
				break;
		}
		
		return $this;
	}
782136
protected function setMode()
    {
        $this->outerStyle = [
            'display'          => 'none',
            'z-index'          => 10000,
            'position'         => 'fixed',
            'background-color' => '#fff',
            'font-size'        => '12px',
            'color'            => '#000'
        ];
        $this->innerStyle = ['margin' => '10px'];
        $this->buttonStyle = ['margin-left' => '10px'];

        switch ($this->mode) {
            case 'bottom':
                $this->outerStyle = array_merge(
                                        $this->outerStyle, 
                                        [
                                            'bottom'     => 0,
                                            'left'       => 0,
                                            'width'      => '100%',
                                            'box-shadow' => '0 -2px 2px #000',
                                        ]
                                    );
                break;
            case 'box':
                $this->outerStyle = array_merge(
                                        $this->outerStyle, 
                                        [
                                            'bottom'        => '20px',
                                            'right'         => '20px',
                                            'width'         => '300px',
                                            'box-shadow'    => '-2px 2px 2px #000',
                                            'border-radius' => '10px',
                                        ]
                                    );
                break;
            case 'custom':
                $this->outerStyle = [];
                $this->innerStyle = [];
                $this->buttonStyle = [];
                break;
            case 'top':
            default:
                $this->outerStyle = array_merge(
                                        $this->outerStyle, 
                                        [
                                            'top'        => 0,
                                            'left'       => 0,
                                            'width'      => '100%',
                                            'box-shadow' => '0 2px 2px #000',
                                        ]
                                    );
        }
    }
899731
public function mode($mode)
    {
        $acceptable_modes = [-1, 0, 1, 2];
        if (!in_array($mode, $acceptable_modes)) {
            throw new JSONLibraryException('bad_mode_set');
        }
        $this->mode = $mode;

        return $this;
    }
206880
public function setConditionMode(string $conditionMode)
    {
        if (!in_array($conditionMode, [self::CONDITION_MODE_AND, self::CONDITION_MODE_OR], true)) {
            throw Exception\InvalidArgumentException::format(
                'Invalid condition mode supplied to %s: expecting one of (%s), \'%s\' given',
                __METHOD__, Debug::formatValues([self::CONDITION_MODE_AND, self::CONDITION_MODE_OR]), $conditionMode
            );
        }

        $this->conditionMode = $conditionMode;

        return $this;
    }
950254
public function setCreateMode(int $createMode): self
    {
        $this->createModeOctal       = $createMode;
        $this->createModeOctalString = decoct($createMode);

        return $this;
    }
281845
public function setPaymentMode($mode)
    {

        try {
            if ($mode instanceof PagSeguroPaymentMode) {
                $this->paymentMode = $mode;
            } else {
                $this->paymentMode = new PagSeguroPaymentMode($mode);
            }
        } catch (Exception $e) {
            die($e->getMessage());
        }
    }
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);
        }
    }
691093
public Ftp setMode(FtpMode mode) {
		this.mode = mode;
		switch (mode) {
		case Active:
			this.client.enterLocalActiveMode();
			break;
		case Passive:
			this.client.enterLocalPassiveMode();
			break;
		}
		return this;
	}
515850
public function setMode($mode) {
        if (!empty($mode)) {
            $mode = strtolower($mode);
            if (!array_key_exists($mode, $this->supportedModes)) {
                throw new \Cityware\Exception\InvalidArgumentException(
                "The mode $mode is not supported by " . __CLASS__
                );
            }
            $this->mode = $mode;
        }

        return $this;
    }
1046788
public static function load($mode)
    {
		if (!is_string($mode)){
			throw new InvalidArgumentException('Try to load an irregular mode in the context. The mode must be a string, ' . gettype($mode) . ' given.');
		}
    	else if (empty($mode)){
    		throw new InvalidArgumentException('Cannot load an empty mode in the context.');
    	}
    	
    	if(!in_array($mode, self::$current)){
    		self::$current[] = $mode;
    	}
    }
1068907
public void setDialogMode(int mode) {
        if (!(mode == OK_CANCEL_DIALOG || mode == CLOSE_DIALOG)) {
            throw new IllegalArgumentException("invalid dialog mode");
        }

        if (okButton != null) {
            buttonPane.remove(okButton);
            okButton = null;
        }
        if (cancelOrCloseButton != null) {
            buttonPane.remove(cancelOrCloseButton);
            cancelOrCloseButton = null;
        }

        switch (mode) {
            case OK_CANCEL_DIALOG:
                okButton
                        = new JButton(ResourceManager.all(BaseDialog.class).getString("ok"));
                okButton.addActionListener(okAction);
                buttonPane.add(okButton);
                cancelOrCloseButton
                        = new JButton(
                                ResourceManager.all(BaseDialog.class).getString("cancel"));
                cancelOrCloseButton.addActionListener(cancelOrCloseAction);
                buttonPane.add(cancelOrCloseButton);
                getRootPane().setDefaultButton(okButton);
                break;
            case CLOSE_DIALOG:
                cancelOrCloseButton
                        = new JButton(ResourceManager.all(BaseDialog.class).getString("close"));
                cancelOrCloseButton.addActionListener(cancelOrCloseAction);
                buttonPane.add(cancelOrCloseButton);
                break;
        }

        this.mode = mode;
    }
701360
public function begin($mode = IExpressionGroup::MODE_AND)
    {
        $parentGroup = $this->currentExpressionGroup;

        $group = $this->queryBuilderFactory->createExpressionGroup($mode, $parentGroup);
        if ($parentGroup) {
            $parentGroup->addGroup($group);
        }

        $this->currentExpressionGroup = $group;

        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");
        }
    }
193395
protected function setMode($mode) {
    $mode = strtolower($mode);

    // These are largely ignored, as the remote
    // object storage does not distinguish between
    // text and binary files. Per the PHP recommendation
    // files are treated as binary.
    $this->isBinary = strpos($mode, 'b') !== FALSE;
    $this->isText = strpos($mode, 't') !== FALSE;

    // Rewrite mode to remove b or t:
    $mode = preg_replace('/[bt]?/', '', $mode);

    switch ($mode) {
      case 'r+':
        $this->isWriting = TRUE;
      case 'r':
        $this->isReading = TRUE;
        $this->createIfNotFound = FALSE;
        break;


      case 'w+':
        $this->isReading = TRUE;
      case 'w':
        $this->isTruncating = TRUE;
        $this->isWriting = TRUE;
        break;


      case 'a+':
        $this->isReading = TRUE;
      case 'a':
        $this->isAppending = TRUE;
        $this->isWriting = TRUE;
        break;


      case 'x+':
        $this->isReading = TRUE;
      case 'x':
        $this->isWriting = TRUE;
        $this->noOverwrite = TRUE;
        break;

      case 'c+':
        $this->isReading = TRUE;
      case 'c':
        $this->isWriting = TRUE;
        break;

      // nope mode: Mock read/write support,
      // but never write to the remote server.
      // (This is accomplished by never marking
      // the stream as dirty.)
      case 'nope':
        $this->isReading = TRUE;
        $this->isWriting = TRUE;
        $this->isNeverDirty = TRUE;
        break;

      // Default case is read/write
      // like c+.
      default:
        $this->isReading = TRUE;
        $this->isWriting = TRUE;
        break;

    }

    return $this;
  }
693248
public function switchAndSave( $mode ) {
		$this->originalMode = $this->mode;
		$this->mode = $mode;
		$this->handler = $this->dispatchTable[$mode];
		return $this->handler;
	}
917538
public function setUnserializeMode($unserializeMode)
    {
        switch ($unserializeMode) {
            case self::STRICT_MODE:
            case self::MEDIUM_STRICT_MODE:
            case self::NON_STRICT_MODE:
                $this->unserializeMode = $unserializeMode;
                break;
            default:
                throw new InvalidArgumentException(sprintf('Non acceptable unserialize mode: "%s"', $unserializeMode));
        }

        return $this;
    }