1 | <?php |
||
9 | class FacebookPosterPost |
||
10 | { |
||
11 | /** @var string */ |
||
12 | protected $content; |
||
13 | |||
14 | /** @object FacebookPosterLink */ |
||
15 | protected $link; |
||
16 | |||
17 | /** @object FacebookPosterImage */ |
||
18 | protected $image; |
||
19 | |||
20 | /** @object FacebookPosterVideo */ |
||
21 | protected $video; |
||
22 | |||
23 | /** |
||
24 | * @var string |
||
25 | */ |
||
26 | private $apiEndpoint = 'me/feed'; |
||
27 | |||
28 | public function __construct($postContent) |
||
32 | |||
33 | /** |
||
34 | * Get Post content. |
||
35 | * |
||
36 | * @return string |
||
37 | */ |
||
38 | public function getContent() |
||
42 | |||
43 | /** |
||
44 | * Set facebook post main link. |
||
45 | * |
||
46 | * @param string $link |
||
47 | * |
||
48 | * @return $this |
||
49 | */ |
||
50 | public function withLink($link) |
||
56 | |||
57 | /** |
||
58 | * Set facebook post image. |
||
59 | * |
||
60 | * @param $imagePath |
||
61 | * @param string $endpoint |
||
62 | * |
||
63 | * @return $this |
||
64 | */ |
||
65 | public function withImage($imagePath, $endpoint = 'me/photos') |
||
71 | |||
72 | /** |
||
73 | * Set facebook post image. |
||
74 | * |
||
75 | * @param $videoPath |
||
76 | * @param array $data |
||
77 | * @param string $endpoint |
||
78 | * |
||
79 | * @return $this |
||
80 | */ |
||
81 | public function withVideo($videoPath, $data = [], $endpoint = 'me/videos') |
||
95 | |||
96 | /** |
||
97 | * Return Facebook Post api endpoint. |
||
98 | * |
||
99 | * @return string |
||
100 | */ |
||
101 | public function getApiEndpoint() |
||
105 | |||
106 | /** |
||
107 | * Build Facebook post request body. |
||
108 | * |
||
109 | * @return array |
||
110 | */ |
||
111 | public function getPostBody() |
||
131 | } |
||
132 |