保存数据
@param array $option 参数
7403
public function save($fileName = null)
	{
		$file = fopen(empty($fileName) ? $this->fileName : $fileName,'w');
		flock($file,LOCK_EX);
		foreach($this->data as $section => $data)
		{
			fwrite($file, '[' . $section . ']' . PHP_EOL);
			foreach($data as $key => $value)
			{
				fwrite($file, $key . '=' . $value . PHP_EOL);
			}
		}
		fclose($file);
	}
334830
public function saveOrFail(array $options = [])
    {
        if ($this->isInvalid()) {
            return $this->throwValidationException();
        }

        return $this->getModel()->parentSaveOrFail($options);
    }
302386
private function SaveOptions(array $options)
    {
        $prev = null;
        foreach ($options as $value=>$text)
        {
            $option = new RadioOption();
            $option->SetRadioField($this->radio);
            $option->SetPrevious($prev);
            $option->SetText($text);
            $option->SetValue($value);
            $option->Save();
            $prev = $option;
        }
    }
609863
public static function saveAs($file, $options = [])
    {
        if (!($file instanceof UploadedFile)) {
            $file = UploadedFile::getInstanceByName($file);
        }
        $options['file'] = $file;
        $model = new static($options);
        return $model->save() ? $model : false;
    }
323214
@CommandArgument
  public void save(
      @OptionArgument("filename") String filename) {

    try {
      PrintStream out = new PrintStream(new FileOutputStream(filename));

      for (User user : users.values()) {
        out.println(user);
      }
    } catch (IOException e) {
      e.printStackTrace();
    }

  }
466717
public function save(Option $option): bool
    {
        $key = $option->getKey();

        foreach ($this->repositories as $repository) {
            if ($repository->has($key)) {
                return $repository->save($option);
            }
        }

        throw UnknownOptionKey::fromKey($key);
    }
333555
public function delete_data_from_cache($option = null)
    {
        $this->value = $this->vocabularyId = $this->vocabularyType = null;
        $this->record->delete_data_from_cache(record_adapter::CACHE_TITLE);
        $this->record->get_caption()->delete_data_from_cache();

        unset(self::$localCache[$this->get_cache_key($option)]);
    }
533521
public function save(array $options = array())
    {
        $result = false;
        
        if ($this->pricelistId) {
            $result = parent::save($options);
            $order = Order::find($this->id);
            $order->pricelists()->attach($this->pricelistId);
        } else {
            throw new Exception('pricelist_id not set.');
        }
        
        return $result;
    }
1321217
public function store(UploadFile $file, $location = null, array $option = [])
    {
        $content = $file->getContent();
        $stream = fopen('php://temp', 'w+b');

        fwrite($stream, $content);
        rewind($stream);

        $result = $this->writeStream($location, $stream, $option);
        fclose($stream);

        if ($result === false) {
            return false;
        }

        $result['content'] = $content;

        return $result;
    }
97420
public function save(array $options = [])
    {
        try {
            // Save model to database
            $result = parent::save($options);

            // If save has been aborted from an event/observer
            // or simply returned an empty response, we'll treat
            // it as a failed save and throw an exception.
            if (! $result) {
                throw new SaveFailedException(sprintf('Could not save model [%s]. Reason: Save returned false.', get_class($this)));
            }
        } catch (Exception $e) {
            // Catch exceptions and re-throw
            // as our Nodes "save failed" exceptions
            throw (new SaveFailedException(sprintf('Could not save model [%s]. Reason: %s', get_class($this), $e->getMessage())))->setPreviousException($e);
        } catch (Throwable $e) {
            // Add support for PHP 7 throwable interface.
            // Re-throw as our Nodes "save failed" exceptions.
            throw (new SaveFailedException(sprintf('Could not save model [%s]. Reason: %s', get_class($this), $e->getMessage())))->setPreviousException($e);
        }

        return $result;
    }
1327682
public function save($file, $replace = true)
    {
        $filename = $this->rootPath . $file['savepath'] . $file['savename'];
        /* 不覆盖同名文件 */
        if (!$replace && is_file($filename)) {
            $this->error = '存在同名文件' . $file['savename'];

            return false;
        }
        /* 移动文件 */
        if (!move_uploaded_file($file['tmp_name'], $filename)) {
            $this->error = '文件上传保存错误！';

            return false;
        }

        return true;
    }
1122802
public function set($name, $value = '', $option = null) {

        // 参数设置(会覆盖黙认设置)
        if (!is_null($option)) {
            if (is_numeric($option)) {
                $option = ['expire' => $option];
            }
            elseif (is_string($option)) {
                parse_str($option, $option);
            }
            $config = array_merge($this->config, array_change_key_case($option));
        }
        else {
            $config = $this->config;
        }
        $name = $config['prefix'] . $name;
        // 设置cookie
        if (is_array($value)) {
            array_walk_recursive($value, 'self::jsonFormatProtect', 'encode');
            $value = 'nb:' . json_encode($value);
        }
        $expire = !empty($config['expire']) ? $_SERVER['REQUEST_TIME'] + intval($config['expire']) : 0;
        if ($config['setcookie']) {
            setcookie($name, $value, $expire, $config['path'], $config['domain'], $config['secure'], $config['httponly']);
        }
        $_COOKIE[$name] = $value;
    }
40069
public function saveIfExists(array $options = []): bool
    {
        if ($this->exists === false) {
            return false;
        }

        return $this->save($options);
    }
231601
public function finishSave(array $options)
    {
        if ($this->getCacheBusting()) {
            $this->queryCache()->flush($this->getTable());
        }

        parent::finishSave($options);
    }
541930
public function saveOption($optionName, $value)
    {
        $options = $this->getOption();
        $options[$optionName] = $value;

        if ($this->multiSite) {
            update_site_option($this->settingsName, $options);
        } else {
            update_option($this->settingsName, $options);
        }
    }
928398
public static function save($name, $option = array())
	{
		$obj = self::getInstance($name);
		if ($obj)
		{
			return $obj->save($option);
		}
		else
		{
			return false;
		}
	}
833653
public function save(array $options = array(), $force = false)
    {
        if ( $force || $this->validate() )
        {
            return $this->performSave($options);
        } else
        {
            return false;
        }
    }