LLMS_Notification::set( string $key, mixed $val )
Set object variables
Parameters Parameters
- $key
-
(string) (Required) variable name
- $val
-
(mixed) (Required) data
Source Source
File: includes/models/model.llms.notification.php
*
* @since 3.8.0
*
* @param string $key variable name
* @param mixed $val data
*/
public function set( $key, $val ) {
global $wpdb;
switch ( $key ) {
case 'created':
case 'id':
case 'updated':
return false;
break;
default:
$this->$key = $val;
if ( $this->id ) {
// phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared
return $wpdb->query(
$wpdb->prepare(
"UPDATE {$this->get_table()} SET {$key} = %s, updated = %s WHERE id = %d",
$val,
current_time( 'mysql' ),
$this->id
)
); // db call ok; no-cache ok.
// phpcs:enable WordPress.DB.PreparedSQL.InterpolatedNotPrepared
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 3.8.0 | Introduced. |