/var/www/html_us/wp-content/plugins/woocommerce/src/Admin/Marketing/MarketingCampaign.php


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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<?php
/**
 * Represents a marketing/ads campaign for marketing channels.
 *
 * Marketing channels (implementing MarketingChannelInterface) can use this class to map their campaign data and present it to WooCommerce core.
 */

namespace Automattic\WooCommerce\Admin\Marketing;

/**
 * MarketingCampaign class
 *
 * @since x.x.x
 */
class MarketingCampaign {
    
/**
     * The unique identifier.
     *
     * @var string
     */
    
protected $id;

    
/**
     * The marketing campaign type.
     *
     * @var MarketingCampaignType
     */
    
protected $type;

    
/**
     * Title of the marketing campaign.
     *
     * @var string
     */
    
protected $title;

    
/**
     * The URL to the channel's campaign management page.
     *
     * @var string
     */
    
protected $manage_url;

    
/**
     * The cost of the marketing campaign with the currency.
     *
     * @var Price
     */
    
protected $cost;

    
/**
     * The sales of the marketing campaign with the currency.
     *
     * @var Price
     */
    
protected $sales;

    
/**
     * MarketingCampaign constructor.
     *
     * @param string                $id         The marketing campaign's unique identifier.
     * @param MarketingCampaignType $type       The marketing campaign type.
     * @param string                $title      The title of the marketing campaign.
     * @param string                $manage_url The URL to the channel's campaign management page.
     * @param Price|null            $cost       The cost of the marketing campaign with the currency.
     * @param Price|null            $sales      The sales of the marketing campaign with the currency.
     */
    
public function __constructstring $idMarketingCampaignType $typestring $titlestring $manage_url, ?Price $cost null, ?Price $sales null ) {
        
$this->id         $id;
        
$this->type       $type;
        
$this->title      $title;
        
$this->manage_url $manage_url;
        
$this->cost       $cost;
        
$this->sales      $sales;
    }

    
/**
     * Returns the marketing campaign's unique identifier.
     *
     * @return string
     */
    
public function get_id(): string {
        return 
$this->id;
    }

    
/**
     * Returns the marketing campaign type.
     *
     * @return MarketingCampaignType
     */
    
public function get_type(): MarketingCampaignType {
        return 
$this->type;
    }

    
/**
     * Returns the title of the marketing campaign.
     *
     * @return string
     */
    
public function get_title(): string {
        return 
$this->title;
    }

    
/**
     * Returns the URL to manage the marketing campaign.
     *
     * @return string
     */
    
public function get_manage_url(): string {
        return 
$this->manage_url;
    }

    
/**
     * Returns the cost of the marketing campaign with the currency.
     *
     * @return Price|null
     */
    
public function get_cost(): ?Price {
        return 
$this->cost;
    }

    
/**
     * Returns the sales of the marketing campaign with the currency.
     *
     * @return Price|null
     */
    
public function get_sales(): ?Price {
        return 
$this->sales;
    }
}