TODO: Check slug setting can be moved to a more proper place.

Save the model to the database.

@param array $options

@return bool
196261
public function save(array $options = [])
    {
        $this->attributes['slug'] = str_slug($this->attributes['name']);

        return parent::save($options);
    }
467973
protected function performSave(array $options) {

        if ($this->autoPurgeRedundantAttributes) {
            $this->attributes = $this->purgeArray($this->getAttributes());
        }

        if ($this->autoHashPasswordAttributes) {
            $this->attributes = $this->hashPasswordAttributes($this->getAttributes(), static::$passwordAttributes);
        }

        return parent::save($options);
    }
335600
public function save(Model $model, $options = array())
    {
        $options = array_merge(array(
            'filter' => true,
            'observer' => true,
        ), $options);

        if ($options['filter']) {
            $this->filter($model);
        }

        if ($options['observer']) {
            $this->applyHook('saving', $model, $options);
        }

        $modified = $this->connection->persist($this, $model->dump());
        $model->setId($modified['$id']);

        if ($options['observer']) {
            $this->applyHook('saved', $model, $options);
        }

        $model->sync($modified);
        $this->resetCache();
    }
611568
public function beforeSave(Model $model, $options = array()) {
        $settings = $this->settings[$model->alias];

        if (empty($model->data[$model->alias]) ||
            empty($model->data[$model->alias][$settings['field']]) ||
            !empty($model->data[$model->alias][$settings['slug']])) {
            return true;

        } else if ($model->id && !$settings['onUpdate']) {
            return true;
        }

        $slug = $model->data[$model->alias][$settings['field']];

        if (method_exists($model, 'beforeSlug')) {
            $slug = $model->beforeSlug($slug, $this);
        }

        $slug = $this->slugify($model, $slug);

        if (method_exists($model, 'afterSlug')) {
            $slug = $model->afterSlug($slug, $this);
        }

        if (mb_strlen($slug) > ($settings['length'] - 3)) {
            $slug = mb_substr($slug, 0, ($settings['length'] - 3));
        }

        if ($settings['unique']) {
            $slug = $this->_makeUnique($model, $slug);
        }

        $model->data[$model->alias][$settings['slug']] = $slug;

        return true;
    }
413806
public function setPossibleOptions( $options )
	{
		if( !is_array( $options ) )														//  no Array given
			throw InvalidArgumentException( 'No array given.' );						//  throw Exception
		if( $options === $this->possibleOptions )										//  threse Options are already set
			return FALSE;																//  do nothing
		$this->possibleOptions	= $options;												//  set new Options
		return TRUE;																	//  indicate Success
	}
1145479
public function forceSave(array $options = [])
    {
        $currentValidatingSetting = $this->getValidating();

        $this->setValidating(false);

        $result = $this->getModel()->save($options);

        $this->setValidating($currentValidatingSetting);

        return $result;
    }
675737
public function save(array $options = array())
    {
        if ($this->isNew()) {
            $this->queryFields = array();
            $batchInsertOptions = $options;
            $updateOptions = array();
        } else {
            $batchInsertOptions = array();
            $updateOptions = $options;
        }

        $this->getRepository()->save($this, $batchInsertOptions, $updateOptions);

        return $this;
    }
1203555
protected function destroyRecord(array $options = [])
    {
        return $this->runCallbacks('destroy', function() {
            if (static::persistence()->delete($this)) {
                $this->isDestroyed = true;
                return true;
            }
            return false;
        });
    }
858824
public function saveAsync(array $options = [])
    {
        $create = !$this->exists;

        if ($this->fireModelEvent('saving') === false) {
            return false;
        }

        if ($create && $this->fireModelEvent('creating')  === false) {
            return false;
        }

        if (!$create && $this->fireModelEvent('updating') === false) {
            return false;
        }

        if ($this->usesTimestamps()) {
            $this->updateTimestamps();
        }

        $savePromise = $this->newQuery()->saveAsync();

        $savePromise->then(function ($result) use ($create, $options) {
            if (array_get($result, '@metadata.statusCode') === 200) {
                $this->exists = true;
                $this->wasRecentlyCreated = $create;
                $this->fireModelEvent($create ? 'created' : 'updated', false);

                $this->finishSave($options);
            }
        });

        return $savePromise;
    }
1095381
public function save(array $options = [])
    {
        if ($this->translated === false) {
            $this->translated = true;
        }

        T::uncacheTerm($this->term_id);

        parent::save($options);
    }
902771
public function get( $option, $slug ) {

		if ( $this->is_active() ) {

			$this->prepare( $slug );

			$slug = $this->slug;

			if ( isset( $this->plugin[ $slug ][ $option ] ) ) {
				return $this->plugin[ $slug ][ $option ];
			} elseif ( '*' == $option && isset( $this->plugin[ $slug ] ) ) {
				return $this->plugin[ $slug ];
			}

			return false;
		}
	}
496383
public function save(array $options = [])
    {
        return DB::transaction(function() use ($options) {
            $result = parent::save($options);

            foreach ($this->autofilledRelations as $relationship => $relations) {
                if (!empty($relations)) {
                    $this->$relationship()->sync((array)$this->prepForSync($relations));
                }
            }

            return $result;
        });
    }
894169
public function save(array $options = [])
    {
        $data = $this->serialize();

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

        return $this;
    }
228105
protected function postOptions(array $options)
    {
        $this->model = $this->app->make(
            Arr::get($options, 'model', SettingModel::class)
        );
        $this->setConnection(Arr::get($options, 'connection', null));
        $this->setTable(Arr::get($options, 'table', 'settings'));
        $this->setKeyColumn(Arr::get($options, 'columns.key', 'key'));
        $this->setValueColumn(Arr::get($options, 'columns.value', 'value'));
    }
71369
public function exists(array $options = [])
    {
        try {
            $this->connection->getSession($options + [
                'name' => $this->name(),
                'database' => $this->database
            ]);

            return true;
        } catch (NotFoundException $e) {
            return false;
        }
    }
130212
public function save($output, array $options = []) {
		$this->_image->save($output, $options);
		$this->_image = null;
		return true;
	}
334830
public function saveOrFail(array $options = [])
    {
        if ($this->isInvalid()) {
            return $this->throwValidationException();
        }

        return $this->getModel()->parentSaveOrFail($options);
    }