保存数据
@param array $option 参数
1915
public function save($fileName = null)
	{
		file_put_contents(empty($fileName) ? $this->fileName : $fileName, json_encode($this->data), LOCK_EX);
	}
961514
public function save(OptionInterface $option)
    {
        $this->em->persist($option);
        $this->em->flush();

        return $option;
    }
1206108
public function addOption($option)
    {
        if (in_array($option, Generator::$tagOptionKeys)
            && !$this->hasOption($option)
        ) {
            $this->options[] = $option;
        }
    }
407699
public function save(array $options = array())
    {
        $fired = $this->fires();

        $content = count($fired)
            ? str_replace([$fired['before'], $fired['after']], '', $this->content)
            : $this->content;

        $this->setAttribute('content', $content);
        $this->attributes['content'] = $content;
        parent::save($options);
    }
956420
public function add($content, $option = array())
	{
		// 优先使用$option中的数据
		if(!isset($option['content']))
		{
			$option['content'] = $content;
		}
		if(!isset($option['time']))
		{
			$option['time'] = date('Y-m-d H:i:s');
		}
		$this->data[] = $option;
	}
323790
public function options($option, $value=null) 
    {
        if (is_array($option)) {
            foreach ($option as $k=>$v) {
                $this->options($k, $v);
            }
        } else {
            // 兼容转换
            if ($option === 'cookies') {
                $option = 'cookie';
            } elseif ($option === 'headers') {
                $option = 'header';
            }
            
            if (array_key_exists($option, $this->def)) {
                if (method_exists($this, $option)) {
                    $this->$option($value);
                }
            } else {
                $this->options[strtoupper($option)] = $value;
            }
        }
        return $this;
    }
894169
public function save(array $options = [])
    {
        $data = $this->serialize();

        $this->security->getKuzzle()->query(
            $this->security->buildQueryArgs($this->saveActionName),
            $data,
            $options
        );

        return $this;
    }
482170
public function save(array &$a, array $options = [])
    {
        if ($this->eventManager->hasListeners(Events::preSave)) {
            $eventArgs = new EventArgs($this, $a, $options);
            $this->eventManager->dispatchEvent(Events::preSave, $eventArgs);
            $a = $eventArgs->getData();
            $options = $eventArgs->getOptions();
        }

        $result = $this->doSave($a, $options);

        if ($this->eventManager->hasListeners(Events::postSave)) {
            $eventArgs = new MutableEventArgs($this, $result);
            $this->eventManager->dispatchEvent(Events::postSave, $eventArgs);
            $result = $eventArgs->getData();
        }

        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;
    }
231601
public function finishSave(array $options)
    {
        if ($this->getCacheBusting()) {
            $this->queryCache()->flush($this->getTable());
        }

        parent::finishSave($options);
    }
196261
public function save(array $options = [])
    {
        $this->attributes['slug'] = str_slug($this->attributes['name']);

        return parent::save($options);
    }
926713
public function removeOption($option)
    {
        if ($this->hasOption($option)) {
            $key = array_search($option, $this->options);
            unset($this->options[$key]);
        }
    }
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();
    }

  }
1060550
public function save(array $options = [])
    {
        $ignored    = config('antares/ui-components::defaults.ignored', []);
        $this->data = array_except((array) $this->data, $ignored);

        return parent::save();
    }
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;
    }
829869
public function saveIfExistsOrFail(array $options = []): bool
    {
        if ($this->exists === false) {
            return false;
        }

        return $this->saveOrFail($options);
    }
844122
public function import(Option $option)
    {
        foreach ($option->getArgs() as $arg) {
            $this->args[] = $arg;
        }

        foreach ($option->getAll() as $key => $value) {
            $this->set($key, $value);
        }
    }