Completed
Push — master ( 87dec9...762540 )
by Hector
03:12
created

LineItem::setCampaignId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: hborras
5
 * Date: 3/04/16
6
 * Time: 11:59.
7
 */
8
namespace Hborras\TwitterAdsSDK\TwitterAds\Campaign;
9
10
use Hborras\TwitterAdsSDK\TwitterAds\Analytics;
11
use Hborras\TwitterAdsSDK\TwitterAds\Cursor;
12
use Hborras\TwitterAdsSDK\TwitterAds\Resource;
13
use Hborras\TwitterAdsSDK\TwitterAdsException;
14
15
class LineItem extends Analytics
16
{
17
    const RESOURCE_COLLECTION = 'accounts/{account_id}/line_items';
18
    const RESOURCE            = 'accounts/{account_id}/line_items/{id}';
19
20
    const ENTITY = "LINE_ITEM";
21
22
    /** Read Only */
23
    protected $id;
24
    protected $created_at;
25
    protected $updated_at;
26
    protected $deleted;
27
28
    protected $properties = [
29
        'campaign_id',
30
        'bid_amount_local_micro',
31
        'name',
32
        'bid_type',
33
        'automatically_select_bid',
34
        'product_type',
35
        'placements',
36
        'objective',
37
        'paused',
38
        'include_sentiment',
39
        'total_budget_amount_local_micro',
40
        'start_time',
41
        'end_time',
42
        'primary_web_event_tag',
43
        'optimization',
44
        'bid_unit',
45
        'charge_by',
46
        'advertiser_domain',
47
        'advertiser_user_id',
48
    ];
49
50
    /** Writable */
51
    protected $campaign_id;
52
    protected $bid_amount_local_micro;
53
    protected $name;
54
    protected $bid_type;
55
    protected $automatically_select_bid;
56
    protected $product_type;
57
    protected $placements;
58
    protected $objective;
59
    protected $paused;
60
    protected $include_sentiment;
61
    protected $total_budget_amount_local_micro;
62
    protected $start_time;
63
    protected $end_time;
64
    protected $primary_web_event_tag;
65
    protected $optimization;
66
    protected $bid_unit;
67
    protected $charge_by;
68
    protected $advertiser_domain;
69
    protected $tracking_tags;
70
    protected $advertiser_user_id;
71
72
    /**
73
     * Returns a collection of targeting criteria available to the
74
     * current line item.
75
     *
76
     * @param string $id
77
     * @param array $params
78
     *
79
     * @return Cursor | Resource
80
     *
81
     * @throws TwitterAdsException
82
     */
83
    public function getTargetingCriteria($id = '', $params = [])
84
    {
85
        $targetingCriteria = new TargetingCriteria();
86
        $targetingCriteria->setAccount($this->getAccount());
87
88
        $this->validateLoaded();
89
        if ($id == '') {
90
            $cursor = $targetingCriteria->line_item_all($this->getId(), $params);
91
        } else {
92
            $cursor = $targetingCriteria->load($id, $params);
0 ignored issues
show
Bug Compatibility introduced by
The expression $targetingCriteria->load($id, $params); of type Hborras\TwitterAdsSDK\Tw...paign\TargetingCriteria adds the type Hborras\TwitterAdsSDK\Tw...paign\TargetingCriteria to the return on line 95 which is incompatible with the return type documented by Hborras\TwitterAdsSDK\Tw...m::getTargetingCriteria of type Hborras\TwitterAdsSDK\TwitterAds\Cursor.
Loading history...
93
        }
94
95
        return $cursor;
96
    }
97
98
    /**
99
     * @return mixed
100
     */
101
    public function getId()
102
    {
103
        return $this->id;
104
    }
105
106
    /**
107
     * @return mixed
108
     */
109
    public function getCreatedAt()
110
    {
111
        return $this->created_at;
112
    }
113
114
    /**
115
     * @return mixed
116
     */
117
    public function getUpdatedAt()
118
    {
119
        return $this->updated_at;
120
    }
121
122
    /**
123
     * @return mixed
124
     */
125
    public function getDeleted()
126
    {
127
        return $this->deleted;
128
    }
129
130
    /**
131
     * @return array
132
     */
133
    public function getProperties()
134
    {
135
        return $this->properties;
136
    }
137
138
    /**
139
     * @param array $properties
140
     */
141
    public function setProperties($properties)
142
    {
143
        $this->properties = $properties;
144
    }
145
146
    /**
147
     * @return mixed
148
     */
149
    public function getCampaignId()
150
    {
151
        return $this->campaign_id;
152
    }
153
154
    /**
155
     * @param mixed $campaign_id
156
     */
157
    public function setCampaignId($campaign_id)
158
    {
159
        $this->campaign_id = $campaign_id;
160
    }
161
162
    /**
163
     * @return mixed
164
     */
165
    public function getBidAmountLocalMicro()
166
    {
167
        return $this->bid_amount_local_micro;
168
    }
169
170
    /**
171
     * @param mixed $bid_amount_local_micro
172
     */
173
    public function setBidAmountLocalMicro($bid_amount_local_micro)
174
    {
175
        $this->bid_amount_local_micro = $bid_amount_local_micro;
176
    }
177
178
    /**
179
     * @return mixed
180
     */
181
    public function getName()
182
    {
183
        return $this->name;
184
    }
185
186
    /**
187
     * @param mixed $name
188
     */
189
    public function setName($name)
190
    {
191
        $this->name = $name;
192
    }
193
194
    /**
195
     * @return mixed
196
     */
197
    public function getBidType()
198
    {
199
        return $this->bid_type;
200
    }
201
202
    /**
203
     * @param mixed $bid_type
204
     */
205
    public function setBidType($bid_type)
206
    {
207
        $this->bid_type = $bid_type;
208
    }
209
210
    /**
211
     * @return mixed
212
     */
213
    public function getAutomaticallySelectdBid()
214
    {
215
        return $this->automatically_select_bid;
216
    }
217
218
    /**
219
     * @param mixed $automatically_select_bid
220
     */
221
    public function setAutomaticallySelectBid($automatically_select_bid)
222
    {
223
        $this->automatically_select_bid = $automatically_select_bid;
224
    }
225
226
    /**
227
     * @return mixed
228
     */
229
    public function getProductType()
230
    {
231
        return $this->product_type;
232
    }
233
234
    /**
235
     * @param mixed $product_type
236
     */
237
    public function setProductType($product_type)
238
    {
239
        $this->product_type = $product_type;
240
    }
241
242
    /**
243
     * @return mixed
244
     */
245
    public function getPlacements()
246
    {
247
        return $this->placements;
248
    }
249
250
    /**
251
     * @param mixed $placements
252
     */
253
    public function setPlacements($placements)
254
    {
255
        $this->placements = $placements;
256
    }
257
258
    /**
259
     * @return mixed
260
     */
261
    public function getObjective()
262
    {
263
        return $this->objective;
264
    }
265
266
    /**
267
     * @param mixed $objective
268
     */
269
    public function setObjective($objective)
270
    {
271
        $this->objective = $objective;
272
    }
273
274
    /**
275
     * @return mixed
276
     */
277
    public function getPaused()
278
    {
279
        return $this->paused;
280
    }
281
282
    /**
283
     * @param mixed $paused
284
     */
285
    public function setPaused($paused)
286
    {
287
        $this->paused = $paused;
288
    }
289
290
    /**
291
     * @return mixed
292
     */
293
    public function getIncludeSentiment()
294
    {
295
        return $this->include_sentiment;
296
    }
297
298
    /**
299
     * @param mixed $include_sentiment
300
     */
301
    public function setIncludeSentiment($include_sentiment)
302
    {
303
        $this->include_sentiment = $include_sentiment;
304
    }
305
306
    /**
307
     * @return mixed
308
     */
309
    public function getTotalBudgetAmountLocalMicro()
310
    {
311
        return $this->total_budget_amount_local_micro;
312
    }
313
314
    /**
315
     * @param mixed $total_budget_amount_local_micro
316
     */
317
    public function setTotalBudgetAmountLocalMicro($total_budget_amount_local_micro)
318
    {
319
        $this->total_budget_amount_local_micro = $total_budget_amount_local_micro;
320
    }
321
322
    /**
323
     * @return mixed
324
     */
325
    public function getStartTime()
326
    {
327
        return $this->start_time;
328
    }
329
330
    /**
331
     * @param mixed $start_time
332
     */
333
    public function setStartTime($start_time)
334
    {
335
        $this->start_time = $start_time;
336
    }
337
338
    /**
339
     * @return mixed
340
     */
341
    public function getEndTime()
342
    {
343
        return $this->end_time;
344
    }
345
346
    /**
347
     * @param mixed $end_time
348
     */
349
    public function setEndTime($end_time)
350
    {
351
        $this->end_time = $end_time;
352
    }
353
354
    /**
355
     * @return mixed
356
     */
357
    public function getPrimaryWebEventTag()
358
    {
359
        return $this->primary_web_event_tag;
360
    }
361
362
    /**
363
     * @param mixed $primary_web_event_tag
364
     */
365
    public function setPrimaryWebEventTag($primary_web_event_tag)
366
    {
367
        $this->primary_web_event_tag = $primary_web_event_tag;
368
    }
369
370
    /**
371
     * @return mixed
372
     */
373
    public function getOptimization()
374
    {
375
        return $this->optimization;
376
    }
377
378
    /**
379
     * @param mixed $optimization
380
     */
381
    public function setOptimization($optimization)
382
    {
383
        $this->optimization = $optimization;
384
    }
385
386
    /**
387
     * @return mixed
388
     */
389
    public function getBidUnit()
390
    {
391
        return $this->bid_unit;
392
    }
393
394
    /**
395
     * @param mixed $bid_unit
396
     */
397
    public function setBidUnit($bid_unit)
398
    {
399
        $this->bid_unit = $bid_unit;
400
    }
401
402
    /**
403
     * @return mixed
404
     */
405
    public function getChargeBy()
406
    {
407
        return $this->charge_by;
408
    }
409
410
    /**
411
     * @param mixed $charge_by
412
     */
413
    public function setChargeBy($charge_by)
414
    {
415
        $this->charge_by = $charge_by;
416
    }
417
418
    /**
419
     * @return mixed
420
     */
421
    public function getAdvertiserDomain()
422
    {
423
        return $this->advertiser_domain;
424
    }
425
426
    /**
427
     * @param mixed $advertiser_domain
428
     */
429
    public function setAdvertiserDomain($advertiser_domain)
430
    {
431
        $this->advertiser_domain = $advertiser_domain;
432
    }
433
434
    /**
435
     * @return mixed
436
     */
437
    public function getTrackingTags()
438
    {
439
        return $this->tracking_tags;
440
    }
441
442
    /**
443
     * @param mixed $tracking_tags
444
     */
445
    public function setTrackingTags($tracking_tags)
446
    {
447
        $this->tracking_tags = $tracking_tags;
448
    }
449
450
    /**
451
     * @return mixed
452
     */
453
    public function getAdvertiserUserId()
454
    {
455
        return $this->advertiser_user_id;
456
    }
457
458
    /**
459
     * @param mixed $advertiser_user_id
460
     */
461
    public function setAdvertiserUserId($advertiser_user_id)
462
    {
463
        $this->advertiser_user_id = $advertiser_user_id;
464
    }
465
}
466