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
Return Return
(mixed)
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; }
Expand full source code Collapse full source code View on GitHub
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. |