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
Return Return
(LLMS_Abstract_Database_Store) Instance of the current object, useful for chaining.
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;
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 3.21.0 | Unknown. |
| 3.14.0 | Introduced. |