AudienceTarget.php
1.55 KB
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
<?php
namespace App\Models;
use App\Models\Pivots\GoalAudienceTarget;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Collection;
class AudienceTarget extends Model
{
use SoftDeletes;
const STRATEGY_PRIORITY_LOW = 'LOW';
const STRATEGY_PRIORITY_NORMAL = 'NORMAL';
const STRATEGY_PRIORITY_HIGH = 'HIGH';
protected $table = 'audience_targets';
protected $fillable = [
'external_id',
'ad_group_external_id',
'campaign_external_id',
'retargetinglist_external_id',
'ad_group_id',
'campaign_id',
'retargetinglist_id',
'interest_external_id',
'context_bid',
'strategy_priority',
];
/**
* @return Collection
*/
static public function getPropertiesWatch()
{
return collect([
'ad_group_external_id',
'campaign_external_id',
'retargetinglist_external_id',
'interest_external_id',
'context_bid',
'strategy_priority',
]);
}
public function adGroup()
{
return $this->belongsTo(AdGroup::class, 'ad_group_id');
}
public function campaign()
{
return $this->belongsTo(Campaigns::class, 'campaign_id');
}
public function retargetinglist()
{
return $this->belongsTo(Retargetinglist::class, 'retargetinglist_id');
}
public function goalAudienceTargets()
{
return $this->hasMany(GoalAudienceTarget::class, 'audience_target_id');
}
}