1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of the Superdesk Web Publisher Core Bundle. |
5
|
|
|
* |
6
|
|
|
* Copyright 2016 Sourcefabric z.ú. and contributors. |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please see the |
9
|
|
|
* AUTHORS and LICENSE files distributed with this source code. |
10
|
|
|
* |
11
|
|
|
* @copyright 2016 Sourcefabric z.ú |
12
|
|
|
* @license http://www.superdesk.org/license |
13
|
|
|
*/ |
14
|
|
|
|
15
|
|
|
namespace SWP\Bundle\CoreBundle\Model; |
16
|
|
|
|
17
|
|
|
use SWP\Bundle\ContentBundle\Model\ArticleInterface; |
18
|
|
|
use SWP\Component\Common\Model\TimestampableTrait; |
19
|
|
|
use SWP\Component\MultiTenancy\Model\TenantAwareInterface; |
20
|
|
|
use SWP\Component\MultiTenancy\Model\TenantAwareTrait; |
21
|
|
|
use SWP\Component\Storage\Model\PersistableInterface; |
22
|
|
|
|
23
|
|
|
class FacebookInstantArticlesArticle implements FacebookInstantArticlesArticleInterface, PersistableInterface, TenantAwareInterface |
24
|
|
|
{ |
25
|
|
|
use TenantAwareTrait, TimestampableTrait; |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* @var int |
29
|
|
|
*/ |
30
|
|
|
protected $id; |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* @var string |
34
|
|
|
*/ |
35
|
|
|
protected $submissionId; |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* @var ArticleInterface |
39
|
|
|
*/ |
40
|
|
|
protected $article; |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* @var string |
44
|
|
|
*/ |
45
|
|
|
protected $status; |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* @var array |
49
|
|
|
*/ |
50
|
|
|
protected $errors = '{}'; |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* @var FacebookInstantArticlesFeedInterface |
54
|
|
|
*/ |
55
|
|
|
protected $feed; |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* {@inheritdoc} |
59
|
|
|
*/ |
60
|
|
|
public function getId(): int |
61
|
|
|
{ |
62
|
|
|
return $this->id; |
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
/** |
66
|
|
|
* {@inheritdoc} |
67
|
|
|
*/ |
68
|
|
|
public function getSubmissionId(): string |
69
|
|
|
{ |
70
|
|
|
return $this->submissionId; |
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
/** |
74
|
|
|
* {@inheritdoc} |
75
|
|
|
*/ |
76
|
|
|
public function setSubmissionId(string $submissionId) |
77
|
|
|
{ |
78
|
|
|
$this->submissionId = $submissionId; |
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
/** |
82
|
|
|
* {@inheritdoc} |
83
|
|
|
*/ |
84
|
|
|
public function getArticle(): ArticleInterface |
85
|
|
|
{ |
86
|
|
|
return $this->article; |
87
|
|
|
} |
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* {@inheritdoc} |
91
|
|
|
*/ |
92
|
|
|
public function setArticle(ArticleInterface $article) |
93
|
|
|
{ |
94
|
|
|
$this->article = $article; |
95
|
|
|
} |
96
|
|
|
|
97
|
|
|
/** |
98
|
|
|
* {@inheritdoc} |
99
|
|
|
*/ |
100
|
|
|
public function getStatus(): string |
101
|
|
|
{ |
102
|
|
|
return $this->status; |
103
|
|
|
} |
104
|
|
|
|
105
|
|
|
/** |
106
|
|
|
* {@inheritdoc} |
107
|
|
|
*/ |
108
|
1 |
|
public function setStatus(string $status) |
109
|
|
|
{ |
110
|
1 |
|
$this->status = $status; |
111
|
1 |
|
} |
112
|
|
|
|
113
|
|
|
/** |
114
|
|
|
* {@inheritdoc} |
115
|
|
|
*/ |
116
|
|
|
public function getErrors(): array |
117
|
|
|
{ |
118
|
|
|
return json_decode($this->errors, true); |
119
|
|
|
} |
120
|
|
|
|
121
|
|
|
/** |
122
|
|
|
* {@inheritdoc} |
123
|
|
|
*/ |
124
|
1 |
|
public function setErrors(array $errors) |
125
|
|
|
{ |
126
|
1 |
|
$this->errors = json_encode($errors); |
127
|
1 |
|
} |
128
|
|
|
|
129
|
|
|
/** |
130
|
|
|
* {@inheritdoc} |
131
|
|
|
*/ |
132
|
1 |
|
public function getFeed(): FacebookInstantArticlesFeedInterface |
133
|
|
|
{ |
134
|
1 |
|
return $this->feed; |
135
|
|
|
} |
136
|
|
|
|
137
|
|
|
/** |
138
|
|
|
* {@inheritdoc} |
139
|
|
|
*/ |
140
|
3 |
|
public function setFeed(FacebookInstantArticlesFeedInterface $feed) |
141
|
|
|
{ |
142
|
3 |
|
$this->feed = $feed; |
143
|
3 |
|
} |
144
|
|
|
} |
145
|
|
|
|