LLMS_Abstract_Database_Store::get( string $key, boolean $cache = true )

Get object data


Parameters Parameters

$key

(string) (Required) Key to retrieve.

$cache

(boolean) (Optional) If true, save data to to the object for future gets.

Default value: true


Top ↑

Return Return

(mixed)


Top ↑

Source Source

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

	public function get( $key, $cache = true ) {

		$key_exists = isset( $this->data[ $key ] );
		if ( ! $key_exists && $this->id ) {
			$res = $this->read( $key )[ $key ];
			if ( $cache ) {
				$this->set( $key, $res );
			}
			return $res;
		}
		return $key_exists ? $this->$key : null;

	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.36.0 Prevent undefined index error when attempting to retrieve an unset value from an unsaved object.
3.16.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.