保存记录
@return void
355196
public function save()
    {
        $redis = static::__getRedis($this);
        if(null === $this->__ttl)
        {
            $redis->set($this->__getKey(), $this->toArray());
        }
        else
        {
            $redis->set($this->__getKey(), $this->toArray(), $this->__ttl);
        }
    }
666824
public function save() {
      if (!$this->isChanged()) {
        return true;
      }
      $newCode = $this->collection->assemble();
      return file_put_contents($this->path, $newCode);
    }
1021149
public function save()
    {
        if (count($this) == 0) {
            return;
        }
        $helper = reset($this->rows);
        $qb = new QueryBuilder($helper->getTableName());
        $qb->setQueryType(QueryBuilder::QUERY_TYPE_UPDATE);
        $qb->setModelData($this);
        $qb->addWhere($helper->getPrimaryKey(), 'IN', $this->getPrimaryKeyList());
        $statement = $qb->getStatement();
        $statement->closeCursor();
    }
320342
public function save()
    {
        if (!$this->url)
        {
            $response = $this->upload();
            $this->url = $response['url'];
            $this->name = $response['name'];
        }

        return true;
    }
202473
public function save()
    {
        $contents = $this->getForStorage();

        if ($this->ttl !== null) {
            $this->client->put($this->key, $contents, $this->ttl);
        } else {
            $this->client->forever($this->key, $contents);
        }
    }
1158233
public function save()
    {
        $file = $this->getFilename() . '.' . $this->getFileExtension();

        // Add save path if given
        if (null !== $this->savePath) {
            $file = $this->savePath . $file;
        }

        file_put_contents(
            $file,
            $this->getOutput()
        );
    }
1059505
public function save() {
        $configdata = $this->get('configdata');
        if (!array_key_exists('defaultvalue_editor', $configdata)) {
            $this->field->save();
            return;
        }

        if (!$this->get('id')) {
            $this->field->save();
        }

        // Store files.
        $textoptions = $this->value_editor_options();
        $tempvalue = (object) ['defaultvalue_editor' => $configdata['defaultvalue_editor']];
        $tempvalue = file_postupdate_standard_editor($tempvalue, 'defaultvalue', $textoptions, $textoptions['context'],
            'customfield_textarea', 'defaultvalue', $this->get('id'));

        $configdata['defaultvalue'] = $tempvalue->defaultvalue;
        $configdata['defaultvalueformat'] = $tempvalue->defaultvalueformat;
        unset($configdata['defaultvalue_editor']);
        $this->field->set('configdata', json_encode($configdata));
        $this->field->save();
    }
245335
public function save(): IResult
    {
        $query = static::query($this);
        $query = $this->parseWhereId($query);
        $data = static::parseSaveData($this);

        // 保存前
        $this->trigger(ModelEvents::BEFORE_SAVE, [
            'model' => $this,
            'data'  => $data,
            'query' => $query,
        ], $this, \Imi\Model\Event\Param\BeforeSaveEventParam::class);

        $result = $query->replace($data);

        // 保存后
        $this->trigger(ModelEvents::AFTER_SAVE, [
            'model' => $this,
            'data'  => $data,
            'result'=> $result,
        ], $this, \Imi\Model\Event\Param\BeforeSaveEventParam::class);

        return $result;
    }
20882
function save()
    {
        $this->_save = false;
        if ($this->_change == 0 or $this->_change == 1)
        {
            if ($this->db->insert($this->_data, $this->table) === false)
            {
                return false;
            }
            //改变状态
            $this->_change = 1;
            $this->_current_id = $this->db->lastInsertId();
        }
        elseif ($this->_change == 2)
        {
            $update = $this->_update;
            unset($update[$this->primary]);
            if ($this->db->update($this->_current_id, $update, $this->table, $this->primary) === false)
            {
                return false;
            }
        }
        $this->notify();
        return true;
    }
885939
function save() {
    // we must reset the colour cache or it will keep bad colours after clipping
    $this->currentColour = null;
    $this->currentStrokeColour = null;
    $this->objects[$this->currentContents]['c'].=  "\nq";
  }
438826
public function save()
    {
        if (!$this->isNew()) {
            $this->setStatus(self::STATUS_UPDATED);
        } else {
            $this->setStatus(self::STATUS_CREATED);
        }

        return false;
    }
999990
public function save()
	{
		$this->db->begin();
		foreach($this->data as $item)
		{
			$this->db->insert($this->tableName,$item);
		}
		$this->db->commit();
		return true;
	}
35165
public function save()
    {
        foreach ($this->data as $key => $value) {
            if (!empty($value)) {
                $this->parametersStorage->set($key, $value);
            } else {
                // Remove value to use default
                $this->parametersStorage->remove($key);
            }
        }
    }
843281
public function save() : void
    {
        if ($this->base instanceof Persistable) {
            $this->persister->save($this->base);

            if ($this->logger) {
                $this->logger->info('Model saved successully');
            }
        }
    }
718103
protected function __save()
    {
        $this->parseDate();
        foreach($this->records as $record)
        {
            FileUtil::writeFile($this->getFileName(), $this->getLogString($record) . PHP_EOL, FILE_APPEND);
        }
    }
65361
public function save(): void
    {
        $this->session->flash('message', $this->serialize());
        $this->instance = null;
    }
1186872
public function save()
    {
        $array = $this->toArrayWithoutEmptyValues();

        $query = $this->createQuery();

        $now = (new \DateTime())->format('Y-m-d H:i:s');

        if ($this->{$this->getTableKey()}) {
            $query->setAction('update');
            $query->where($query->buildAndSet([
                [$this->getTableKey(), "=", $this->id],
            ]));

            foreach ($array as $key => $value) {
                $query->addValue($key, $value);
            }

            // Since it's an update, add updated_at if the model implements it
            if (property_exists($this, 'updated_at')) {
                $query->addValue('updated_at', $now);
                $this->updated_at = $now;
            }
        } else {
            $query->setAction('insert');

            foreach ($array as $key => $value) {
                if ($key !== $this->tableKey) {
                    $query->addValue($key, $value);
                }
            }

            // Since it's an insert, add created_at if the model implements it
            if (property_exists($this, 'created_at')) {
                $query->addValue('created_at', $now);
                $this->created_at = $now;
            }
        }
        $result = $this->database->query($query);
        if ($result && $query->getAction() === 'insert') {
            $this->id = $this->database->getInstance()->lastInsertId();
        }
        return $result ? true : false;
    }