Post.php 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461
  1. <?php
  2. /*
  3. * Copyright 2014 Google Inc.
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  6. * use this file except in compliance with the License. You may obtain a copy of
  7. * the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  13. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  14. * License for the specific language governing permissions and limitations under
  15. * the License.
  16. */
  17. namespace Google\Service\Blogger;
  18. class Post extends \Google\Collection
  19. {
  20. public const READER_COMMENTS_ALLOW = 'ALLOW';
  21. public const READER_COMMENTS_DONT_ALLOW_SHOW_EXISTING = 'DONT_ALLOW_SHOW_EXISTING';
  22. public const READER_COMMENTS_DONT_ALLOW_HIDE_EXISTING = 'DONT_ALLOW_HIDE_EXISTING';
  23. public const STATUS_LIVE = 'LIVE';
  24. public const STATUS_DRAFT = 'DRAFT';
  25. public const STATUS_SCHEDULED = 'SCHEDULED';
  26. public const STATUS_SOFT_TRASHED = 'SOFT_TRASHED';
  27. protected $collection_key = 'labels';
  28. protected $authorType = PostAuthor::class;
  29. protected $authorDataType = '';
  30. protected $blogType = PostBlog::class;
  31. protected $blogDataType = '';
  32. /**
  33. * The content of the Post. May contain HTML markup.
  34. *
  35. * @var string
  36. */
  37. public $content;
  38. /**
  39. * The JSON meta-data for the Post.
  40. *
  41. * @deprecated
  42. * @var string
  43. */
  44. public $customMetaData;
  45. /**
  46. * Etag of the resource.
  47. *
  48. * @var string
  49. */
  50. public $etag;
  51. /**
  52. * The identifier of this Post.
  53. *
  54. * @var string
  55. */
  56. public $id;
  57. protected $imagesType = PostImages::class;
  58. protected $imagesDataType = 'array';
  59. /**
  60. * The kind of this entity. Always blogger#post.
  61. *
  62. * @var string
  63. */
  64. public $kind;
  65. /**
  66. * The list of labels this Post was tagged with.
  67. *
  68. * @var string[]
  69. */
  70. public $labels;
  71. protected $locationType = PostLocation::class;
  72. protected $locationDataType = '';
  73. /**
  74. * RFC 3339 date-time when this Post was published.
  75. *
  76. * @var string
  77. */
  78. public $published;
  79. /**
  80. * Comment control and display setting for readers of this post.
  81. *
  82. * @var string
  83. */
  84. public $readerComments;
  85. protected $repliesType = PostReplies::class;
  86. protected $repliesDataType = '';
  87. /**
  88. * The API REST URL to fetch this resource from.
  89. *
  90. * @var string
  91. */
  92. public $selfLink;
  93. /**
  94. * Status of the post. Only set for admin-level requests.
  95. *
  96. * @var string
  97. */
  98. public $status;
  99. /**
  100. * The title of the Post.
  101. *
  102. * @var string
  103. */
  104. public $title;
  105. /**
  106. * The title link URL, similar to atom's related link.
  107. *
  108. * @var string
  109. */
  110. public $titleLink;
  111. /**
  112. * RFC 3339 date-time when this Post was last trashed.
  113. *
  114. * @var string
  115. */
  116. public $trashed;
  117. /**
  118. * RFC 3339 date-time when this Post was last updated.
  119. *
  120. * @var string
  121. */
  122. public $updated;
  123. /**
  124. * The URL where this Post is displayed.
  125. *
  126. * @var string
  127. */
  128. public $url;
  129. /**
  130. * The author of this Post.
  131. *
  132. * @param PostAuthor $author
  133. */
  134. public function setAuthor(PostAuthor $author)
  135. {
  136. $this->author = $author;
  137. }
  138. /**
  139. * @return PostAuthor
  140. */
  141. public function getAuthor()
  142. {
  143. return $this->author;
  144. }
  145. /**
  146. * Data about the blog containing this Post.
  147. *
  148. * @param PostBlog $blog
  149. */
  150. public function setBlog(PostBlog $blog)
  151. {
  152. $this->blog = $blog;
  153. }
  154. /**
  155. * @return PostBlog
  156. */
  157. public function getBlog()
  158. {
  159. return $this->blog;
  160. }
  161. /**
  162. * The content of the Post. May contain HTML markup.
  163. *
  164. * @param string $content
  165. */
  166. public function setContent($content)
  167. {
  168. $this->content = $content;
  169. }
  170. /**
  171. * @return string
  172. */
  173. public function getContent()
  174. {
  175. return $this->content;
  176. }
  177. /**
  178. * The JSON meta-data for the Post.
  179. *
  180. * @deprecated
  181. * @param string $customMetaData
  182. */
  183. public function setCustomMetaData($customMetaData)
  184. {
  185. $this->customMetaData = $customMetaData;
  186. }
  187. /**
  188. * @deprecated
  189. * @return string
  190. */
  191. public function getCustomMetaData()
  192. {
  193. return $this->customMetaData;
  194. }
  195. /**
  196. * Etag of the resource.
  197. *
  198. * @param string $etag
  199. */
  200. public function setEtag($etag)
  201. {
  202. $this->etag = $etag;
  203. }
  204. /**
  205. * @return string
  206. */
  207. public function getEtag()
  208. {
  209. return $this->etag;
  210. }
  211. /**
  212. * The identifier of this Post.
  213. *
  214. * @param string $id
  215. */
  216. public function setId($id)
  217. {
  218. $this->id = $id;
  219. }
  220. /**
  221. * @return string
  222. */
  223. public function getId()
  224. {
  225. return $this->id;
  226. }
  227. /**
  228. * Display image for the Post.
  229. *
  230. * @param PostImages[] $images
  231. */
  232. public function setImages($images)
  233. {
  234. $this->images = $images;
  235. }
  236. /**
  237. * @return PostImages[]
  238. */
  239. public function getImages()
  240. {
  241. return $this->images;
  242. }
  243. /**
  244. * The kind of this entity. Always blogger#post.
  245. *
  246. * @param string $kind
  247. */
  248. public function setKind($kind)
  249. {
  250. $this->kind = $kind;
  251. }
  252. /**
  253. * @return string
  254. */
  255. public function getKind()
  256. {
  257. return $this->kind;
  258. }
  259. /**
  260. * The list of labels this Post was tagged with.
  261. *
  262. * @param string[] $labels
  263. */
  264. public function setLabels($labels)
  265. {
  266. $this->labels = $labels;
  267. }
  268. /**
  269. * @return string[]
  270. */
  271. public function getLabels()
  272. {
  273. return $this->labels;
  274. }
  275. /**
  276. * The location for geotagged posts.
  277. *
  278. * @param PostLocation $location
  279. */
  280. public function setLocation(PostLocation $location)
  281. {
  282. $this->location = $location;
  283. }
  284. /**
  285. * @return PostLocation
  286. */
  287. public function getLocation()
  288. {
  289. return $this->location;
  290. }
  291. /**
  292. * RFC 3339 date-time when this Post was published.
  293. *
  294. * @param string $published
  295. */
  296. public function setPublished($published)
  297. {
  298. $this->published = $published;
  299. }
  300. /**
  301. * @return string
  302. */
  303. public function getPublished()
  304. {
  305. return $this->published;
  306. }
  307. /**
  308. * Comment control and display setting for readers of this post.
  309. *
  310. * Accepted values: ALLOW, DONT_ALLOW_SHOW_EXISTING, DONT_ALLOW_HIDE_EXISTING
  311. *
  312. * @param self::READER_COMMENTS_* $readerComments
  313. */
  314. public function setReaderComments($readerComments)
  315. {
  316. $this->readerComments = $readerComments;
  317. }
  318. /**
  319. * @return self::READER_COMMENTS_*
  320. */
  321. public function getReaderComments()
  322. {
  323. return $this->readerComments;
  324. }
  325. /**
  326. * The container of comments on this Post.
  327. *
  328. * @param PostReplies $replies
  329. */
  330. public function setReplies(PostReplies $replies)
  331. {
  332. $this->replies = $replies;
  333. }
  334. /**
  335. * @return PostReplies
  336. */
  337. public function getReplies()
  338. {
  339. return $this->replies;
  340. }
  341. /**
  342. * The API REST URL to fetch this resource from.
  343. *
  344. * @param string $selfLink
  345. */
  346. public function setSelfLink($selfLink)
  347. {
  348. $this->selfLink = $selfLink;
  349. }
  350. /**
  351. * @return string
  352. */
  353. public function getSelfLink()
  354. {
  355. return $this->selfLink;
  356. }
  357. /**
  358. * Status of the post. Only set for admin-level requests.
  359. *
  360. * Accepted values: LIVE, DRAFT, SCHEDULED, SOFT_TRASHED
  361. *
  362. * @param self::STATUS_* $status
  363. */
  364. public function setStatus($status)
  365. {
  366. $this->status = $status;
  367. }
  368. /**
  369. * @return self::STATUS_*
  370. */
  371. public function getStatus()
  372. {
  373. return $this->status;
  374. }
  375. /**
  376. * The title of the Post.
  377. *
  378. * @param string $title
  379. */
  380. public function setTitle($title)
  381. {
  382. $this->title = $title;
  383. }
  384. /**
  385. * @return string
  386. */
  387. public function getTitle()
  388. {
  389. return $this->title;
  390. }
  391. /**
  392. * The title link URL, similar to atom's related link.
  393. *
  394. * @param string $titleLink
  395. */
  396. public function setTitleLink($titleLink)
  397. {
  398. $this->titleLink = $titleLink;
  399. }
  400. /**
  401. * @return string
  402. */
  403. public function getTitleLink()
  404. {
  405. return $this->titleLink;
  406. }
  407. /**
  408. * RFC 3339 date-time when this Post was last trashed.
  409. *
  410. * @param string $trashed
  411. */
  412. public function setTrashed($trashed)
  413. {
  414. $this->trashed = $trashed;
  415. }
  416. /**
  417. * @return string
  418. */
  419. public function getTrashed()
  420. {
  421. return $this->trashed;
  422. }
  423. /**
  424. * RFC 3339 date-time when this Post was last updated.
  425. *
  426. * @param string $updated
  427. */
  428. public function setUpdated($updated)
  429. {
  430. $this->updated = $updated;
  431. }
  432. /**
  433. * @return string
  434. */
  435. public function getUpdated()
  436. {
  437. return $this->updated;
  438. }
  439. /**
  440. * The URL where this Post is displayed.
  441. *
  442. * @param string $url
  443. */
  444. public function setUrl($url)
  445. {
  446. $this->url = $url;
  447. }
  448. /**
  449. * @return string
  450. */
  451. public function getUrl()
  452. {
  453. return $this->url;
  454. }
  455. }
  456. // Adding a class alias for backwards compatibility with the previous class name.
  457. class_alias(Post::class, 'Google_Service_Blogger_Post');