PluginProbe
MainWP Dashboard: Self-hosted WordPress Management for Agencies / 5.3
MainWP Dashboard: Self-hosted WordPress Management for Agencies v5.3
6.2 6.1.8 6.1.7 6.1.6 6.1.5 6.1.4 6.1.3 6.1.2 6.1.1 6.1 6.0.12 6.0.11 4.6.0.1 5.0 5.0.1 5.0.2 5.0.3 5.0.3.1 5.0.3.2 5.1 5.1.1 5.2 5.2.1 5.2.2 5.3 All 153 releases
mainwp / modules / logs / classes / class-log-record.php

class-log-record.php in MainWP Dashboard: Self-hosted WordPress Management for Agencies 5.3, at modules/logs/classes/class-log-record.php

156 lines 3.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Manages the state of a single record
4 *
5 * @package MainWP/Dashboard
6 */
7
8 namespace MainWP\Dashboard\Module\Log;
9
10 /**
11 * Class - Log_Record
12 */
13 class Log_Record {
14
15 /**
16 * Record log_id
17 *
18 * @var int
19 */
20 public $log_id;
21
22 /**
23 * Date record created
24 *
25 * @var string
26 */
27 public $created;
28
29 /**
30 * Site ID of the site where the record was created
31 *
32 * @var int
33 */
34 public $site_id;
35
36
37 /**
38 * User ID of the record creator
39 *
40 * @var int
41 */
42 public $user_id;
43
44 /**
45 * User role of the record creator
46 *
47 * @var string
48 */
49 public $user_role;
50
51 /**
52 * Record user meta data.
53 *
54 * @var string
55 */
56 public $user_meta;
57
58
59 /**
60 * Record log_site_name
61 *
62 * @var string
63 */
64 public $log_site_name;
65
66 /**
67 * Record url
68 *
69 * @var string
70 */
71 public $url;
72
73 /**
74 * Record item
75 *
76 * @var string
77 */
78 public $item;
79
80 /**
81 * Record connector
82 *
83 * @var string
84 */
85 public $connector;
86
87 /**
88 * Context record was made in.
89 *
90 * @var string
91 */
92 public $context;
93
94 /**
95 * Record action
96 *
97 * @var string
98 */
99 public $action;
100
101 /**
102 * Duration
103 *
104 * @var int
105 */
106 public $duration;
107
108 /**
109 * State
110 *
111 * @var int
112 */
113 public $state;
114
115 /**
116 * Record meta data
117 *
118 * @var array
119 */
120 public $meta;
121
122 /**
123 * Record extra_meta data
124 *
125 * @var array
126 */
127 public $extra_meta;
128
129 /**
130 * Class constructor
131 *
132 * @param object $log Record data object.
133 */
134 public function __construct( $log ) { //phpcs:ignore -- NOSONAR - complex method.
135 $this->log_id = isset( $log->log_id ) ? $log->log_id : null;
136 $this->created = isset( $log->created ) ? $log->created : null;
137 $this->site_id = isset( $log->site_id ) ? $log->site_id : null;
138 $this->log_site_name = isset( $log->log_site_name ) ? $log->log_site_name : null;
139 $this->url = isset( $log->url ) ? $log->url : null;
140 $this->user_id = isset( $log->user_id ) ? $log->user_id : null;
141 $this->user_meta = isset( $log->meta['user_meta'] ) ? $log->meta['user_meta'] : null;
142 $this->item = isset( $log->item ) ? $log->item : null;
143 $this->connector = isset( $log->connector ) ? $log->connector : null;
144 $this->context = isset( $log->context ) ? $log->context : null;
145 $this->action = isset( $log->action ) ? $log->action : null;
146 $this->state = isset( $log->state ) ? $log->state : null;
147 $this->duration = isset( $log->duration ) ? $log->duration : null;
148 $this->meta = isset( $log->meta ) ? $log->meta : null;
149 $this->extra_meta = isset( $log->extra_info ) ? $log->extra_info : null;
150
151 if ( isset( $this->meta['user_meta'] ) ) {
152 unset( $this->meta['user_meta'] );
153 }
154 }
155 }
156