Set & save rendered data

@param   bool $save
@return  mixed
509985
public function saveRenderedReason(bool $save = true)
    {
        $raw = $this->getAttributeFromArray('reason');

        if (($rendered = markdown($raw)) === $this->getAttributeFromArray('reason_rendered')) {
            return null;
        }

        $this->setAttribute('reason_rendered', $rendered);

        if ($save) {
            $this->save();
        }

        $this->renderedReason = $rendered;

        return $this;
    }
494465
public function save()
    {
        $this->load();
        // Do the work in case we have only changed hash
        if ($this->isChanged()) {
            @chmod($this->path, 0777);
            return file_put_contents($this->path, $this->fileType->render($this->config));
        } else {
            return true;
        }
    }
1309671
public function save($item, bool $update = false)
    {
        return Craft::$app->volumes->saveVolume($item);
    }
1148541
public function export(bool $export = true, string $title = ' ')
    {
        return $this->options([
            'toolbox' => [
                'show'    => true,
                'feature' => [
                    'saveAsImage' => [
                        'title' => $title,
                    ],
                ],
            ],
        ]);
    }
731121
public function propagateIdToSources($save = true)
    {
        foreach ($this->translations as $source)
        {
            $source->setExtensionNodeId($this->getKey(), $save);
        }
    }
768931
public function save() {

		$aUpdate =& self::$_lPoolDataChange[$this->_sConfig][$this->_mID];
		$aOrig   =& self::$_lPoolData[$this->_sConfig][$this->_mID];

		if ($aUpdate === $aOrig) {
			return FALSE;
		}

		$aOP = ($aOrig === FALSE) ? $aUpdate : self::_getDiff($aOrig, $aUpdate);

		$aOrig = $aUpdate;

		return $this->_coll()->update(
			[static::$_mKey => $this->_mID],
			$aOP,
			['upsert' => TRUE]
		);
	}
206761
public function save()
    {
        $deferred = new Deferred();

        $this->http->patch('users/@me', $this->getUpdatableAttributes())->then(
            \React\Partial\bind_right($this->resolve, $deferred),
            \React\Partial\bind_right($this->reject, $deferred)
        );

        return $deferred->promise();
    }
274421
public function save($validate = true)
	{
		if ($this->frozen())
		{
			throw new \Exception('Cannot modify a frozen row.');
		}

		$vars = $this->_data;

		// Set default if there are any
		isset(static::$_defaults) and $vars = $vars + static::$_defaults;

		if ($validate and isset(static::$_rules) and ! empty(static::$_rules))
		{
			$vars = $this->pre_validate($vars);
			$validated = $this->post_validate($this->run_validation($vars));

			if ($validated)
			{
				$validated = array_filter($this->validation()->validated(), function($val){
					return ($val !== null);
				});

				$vars = $validated + $vars;
			}
			else
			{
				return false;
			}
		}

		$vars = $this->prep_values($vars);

		if (isset(static::$_properties))
		{
			$vars = \Arr::filter_keys($vars, static::$_properties);
		}

		if(isset(static::$_updated_at))
		{
			if(isset(static::$_mysql_timestamp) and static::$_mysql_timestamp === true)
			{
				$vars[static::$_updated_at] = \Date::forge()->format('mysql');
			}
			else
			{
				$vars[static::$_updated_at] = \Date::forge()->get_timestamp();
			}
		}

		if ($this->is_new())
		{
			if(isset(static::$_created_at))
			{
				if(isset(static::$_mysql_timestamp) and static::$_mysql_timestamp === true)
				{
					$vars[static::$_created_at] = \Date::forge()->format('mysql');
				}
				else
				{
					$vars[static::$_created_at] = \Date::forge()->get_timestamp();
				}
			}

			$query = \DB::insert(static::$_table_name)
			            ->set($vars);

			$this->pre_save($query);
			$result = $query->execute(static::get_connection(true));

			if ($result[1] > 0)
			{
				// workaround for PDO connections not returning the insert_id
				if ($result[0] === false and isset($vars[static::primary_key()]))
				{
					$result[0] = $vars[static::primary_key()];
				}
				$this->set($vars);
				empty($result[0]) or $this->{static::primary_key()} = $result[0];
				$this->is_new(false);
			}

			return $this->post_save($result);
		}

		$query = \DB::update(static::$_table_name)
		         ->set($vars)
		         ->where(static::primary_key(), '=', $this->{static::primary_key()});

		$this->pre_update($query);
		$result = $query->execute(static::get_connection(true));
		$result > 0 and $this->set($vars);

		return $this->post_update($result);
	}
666633
public function save($item, bool $update = false)
    {
        return Craft::$app->globals->saveSet($item);
    }
66072
public static function add(string $entity, array $data, bool $save = true)
    {
        return self::exeCreate($entity, $data, $save);
    }
951912
public function save($updateIndex = false)
    {
        $this->clearCacheTableIndex();
        if ($this->exists()) {
            return $this->update();
        }
        $result = $this->insert();
        if ($result && $updateIndex) {
            $this->setToIndex($result);
        }

        return $result;
    }
336298
public function render(bool $emulate = false)
    {
        $response = $this->getResponse();

        if (!$this->prepare()) {
            return $this;
        }

        if ($response->getStatus() == 200 && !$this->process()) {
            return $this;
        }

        $continue = true;

        //check for content
        //check for redirect
        if (!$response->hasContent()
            && !$response->hasJson()
            && !$this->hasRedirect()
        ) {
            $request = $this->getRequest();
            $response->setStatus(404, HttpHandler::STATUS_404);

            $error = new HttpException(HttpHandler::STATUS_404, 404);

            $continue = $this->getErrorProcessor()->process($request, $response, $error);
        }

        if ($continue) {
            $this->getDispatcher()->dispatch($response, $emulate);
        }

        //the connection is already closed
        //also remember there are no more sessions
        $this->shutdown();

        return $this;
    }
690131
public function set($key, $value, $save = true)
    {
        $this->load();
        NestedArrayUtil::setNestedArrayValue($this->state, explode('.', $key), $value);
        if ($save) {
            $this->save();
        }
    }
1067767
public function saveAlpha(Bool $save = true) : GD
    {
        imagesavealpha($this->canvas, $save);

        return $this;
    }
319164
function save()
    {
        if ($this->id != false || $this->id != 0) {
            return $this->update();
        } else {
            return $this->insert();
        }
    }
657850
public function updateLastActivity($save = true)
    {
        $this->forceFill(['last_activity' => $this->freshTimestamp()]);

        if ($save) $this->save();
    }
672887
public function save($item, bool $update = false)
    {
        if ($update || $item->id) {
            if ($item->id) {
                $field = Craft::$app->fields->getFieldById($item->id);
            } else {
                $field = Craft::$app->fields->getFieldByHandle($item->handle);
            }
            if ($field) {
                if (\get_class($item) !== \get_class($field)) {
                    $error = Architect::t('Type does not match existing type: "{fieldType}".', ['fieldType' => \get_class($field) ]);
                    $item->addError('type', $error);
                    return false;
                }
            }
        }
        return Craft::$app->fields->saveField($item);
    }