1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
<?php // phpcs:ignoreFile
namespace AutomateWoo;
if ( ! defined( 'ABSPATH' ) ) exit;
/** * Order_Note class. * * Supports notes added to subscriptions. * * @since 2.2 */ class Order_Note {
/** @var int */ public $id;
/** @var string */ public $content;
/** * The ID of the associated order or subscription. * * @var int */ public $order_id;
/** @var bool */ public $is_customer_note;
/** * @param $id * @param $content * @param $order_id */ function __construct( $id, $content, $order_id ) { $this->id = $id; $this->content = $content; $this->order_id = $order_id; }
/** * @return bool */ function is_customer_note() { if ( ! isset( $this->is_customer_note ) ) { $this->is_customer_note = (bool) get_comment_meta( $this->id, 'is_customer_note', true ); } return $this->is_customer_note; }
/** * @return string */ function get_type() { return $this->is_customer_note() ? 'customer' : 'private'; }
}
|