PluginProbe
Image Optimizer – Compress Images and Convert to WebP or AVIF / 1.5.4
Image Optimizer – Compress Images and Convert to WebP or AVIF v1.5.4
1.7.7 1.7.6 1.7.5 1.7.4 trunk 1.0.0 1.0.1 1.0.2 1.1.0 1.2.0 1.2.1 1.3.0 1.4.0 1.4.1 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 All 33 releases
image-optimization / vendor / woocommerce / action-scheduler / classes / ActionScheduler_LogEntry.php

ActionScheduler_LogEntry.php in Image Optimizer – Compress Images and Convert to WebP or AVIF 1.5.4, at vendor/woocommerce/action-scheduler/classes/ActionScheduler_LogEntry.php

73 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Class ActionScheduler_LogEntry
5 */
6 class ActionScheduler_LogEntry {
7
8 /**
9 * @var int $action_id
10 */
11 protected $action_id = '';
12
13 /**
14 * @var string $message
15 */
16 protected $message = '';
17
18 /**
19 * @var Datetime $date
20 */
21 protected $date;
22
23 /**
24 * Constructor
25 *
26 * @param mixed $action_id Action ID.
27 * @param string $message Message.
28 * @param Datetime $date Datetime object with the time when this log entry was created. If this parameter is
29 * not provided a new Datetime object (with current time) will be created.
30 */
31 public function __construct( $action_id, $message, $date = null ) {
32 /*
33 * ActionScheduler_wpCommentLogger::get_entry() previously passed a 3rd param of $comment->comment_type
34 * to ActionScheduler_LogEntry::__construct(), goodness knows why, and the Follow-up Emails plugin
35 * hard-codes loading its own version of ActionScheduler_wpCommentLogger with that out-dated method,
36 * goodness knows why, so we need to guard against that here instead of using a DateTime type declaration
37 * for the constructor's 3rd param of $date and causing a fatal error with older versions of FUE.
38 */
39 if ( null !== $date && ! is_a( $date, 'DateTime' ) ) {
40 _doing_it_wrong( __METHOD__, 'The third parameter must be a valid DateTime instance, or null.', '2.0.0' );
41 $date = null;
42 }
43
44 $this->action_id = $action_id;
45 $this->message = $message;
46 $this->date = $date ? $date : new Datetime;
47 }
48
49 /**
50 * Returns the date when this log entry was created
51 *
52 * @return Datetime
53 */
54 public function get_date() {
55 return $this->date;
56 }
57
58 /**
59 * Get action ID of log entry.
60 */
61 public function get_action_id() {
62 return $this->action_id;
63 }
64
65 /**
66 * Get log entry message.
67 */
68 public function get_message() {
69 return $this->message;
70 }
71 }
72
73