LLMS_Abstract_Database_Store::set( string $key, mixed $val, boolean $save = false )

General setter


Parameters Parameters

$key

(string) (Required) Column name.

$val

(mixed) (Required) Column value.

$save

(boolean) (Optional) If true, immediately persists to database.

Default value: false


Top ↑

Return Return

(LLMS_Abstract_Database_Store) Instance of the current object, useful for chaining.


Top ↑

Source Source

File: includes/abstracts/llms.abstract.database.store.php

	public function set( $key, $val, $save = false ) {

		$this->$key = $val;
		if ( $save ) {
			$update = array(
				$key => $val,
			);
			// If update date supported, add an updated date.
			if ( $this->date_updated ) {
				$update[ $this->date_updated ] = llms_current_time( 'mysql' );
			}
			$this->update( $update );
		}

		return $this;

	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.21.0 Unknown.
3.14.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.