aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ApiBundle/Controller/EntryRestController.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/ApiBundle/Controller/EntryRestController.php')
-rw-r--r--src/Wallabag/ApiBundle/Controller/EntryRestController.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php
index 6f161a08..5a9afc69 100644
--- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php
+++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php
@@ -309,6 +309,7 @@ class EntryRestController extends WallabagRestController
309 * {"name"="published_at", "dataType"="datetime|integer", "format"="YYYY-MM-DDTHH:II:SS+TZ or a timestamp", "required"=false, "description"="Published date of the entry"}, 309 * {"name"="published_at", "dataType"="datetime|integer", "format"="YYYY-MM-DDTHH:II:SS+TZ or a timestamp", "required"=false, "description"="Published date of the entry"},
310 * {"name"="authors", "dataType"="string", "format"="Name Firstname,author2,author3", "required"=false, "description"="Authors of the entry"}, 310 * {"name"="authors", "dataType"="string", "format"="Name Firstname,author2,author3", "required"=false, "description"="Authors of the entry"},
311 * {"name"="public", "dataType"="integer", "required"=false, "format"="1 or 0", "description"="will generate a public link for the entry"}, 311 * {"name"="public", "dataType"="integer", "required"=false, "format"="1 or 0", "description"="will generate a public link for the entry"},
312 * {"name"="origin_url", "dataType"="string", "required"=false, "format"="http://www.test.com/article.html", "description"="Origin url for the entry."},
312 * } 313 * }
313 * ) 314 * )
314 * 315 *
@@ -368,6 +369,10 @@ class EntryRestController extends WallabagRestController
368 $this->get('wallabag_core.tags_assigner')->assignTagsToEntry($entry, $data['tags']); 369 $this->get('wallabag_core.tags_assigner')->assignTagsToEntry($entry, $data['tags']);
369 } 370 }
370 371
372 if (!empty($data['origin_url'])) {
373 $entry->setOriginUrl($data['origin_url']);
374 }
375
371 if (null !== $data['isPublic']) { 376 if (null !== $data['isPublic']) {
372 if (true === (bool) $data['isPublic'] && null === $entry->getUid()) { 377 if (true === (bool) $data['isPublic'] && null === $entry->getUid()) {
373 $entry->generateUid(); 378 $entry->generateUid();
@@ -404,6 +409,7 @@ class EntryRestController extends WallabagRestController
404 * {"name"="published_at", "dataType"="datetime|integer", "format"="YYYY-MM-DDTHH:II:SS+TZ or a timestamp", "required"=false, "description"="Published date of the entry"}, 409 * {"name"="published_at", "dataType"="datetime|integer", "format"="YYYY-MM-DDTHH:II:SS+TZ or a timestamp", "required"=false, "description"="Published date of the entry"},
405 * {"name"="authors", "dataType"="string", "format"="Name Firstname,author2,author3", "required"=false, "description"="Authors of the entry"}, 410 * {"name"="authors", "dataType"="string", "format"="Name Firstname,author2,author3", "required"=false, "description"="Authors of the entry"},
406 * {"name"="public", "dataType"="integer", "required"=false, "format"="1 or 0", "description"="will generate a public link for the entry"}, 411 * {"name"="public", "dataType"="integer", "required"=false, "format"="1 or 0", "description"="will generate a public link for the entry"},
412 * {"name"="origin_url", "dataType"="string", "required"=false, "format"="http://www.test.com/article.html", "description"="Origin url for the entry."},
407 * } 413 * }
408 * ) 414 * )
409 * 415 *
@@ -480,6 +486,10 @@ class EntryRestController extends WallabagRestController
480 } 486 }
481 } 487 }
482 488
489 if (!empty($data['origin_url'])) {
490 $entry->setOriginUrl($data['origin_url']);
491 }
492
483 $em = $this->getDoctrine()->getManager(); 493 $em = $this->getDoctrine()->getManager();
484 $em->persist($entry); 494 $em->persist($entry);
485 $em->flush(); 495 $em->flush();
@@ -778,6 +788,7 @@ class EntryRestController extends WallabagRestController
778 'picture' => $request->request->get('preview_picture'), 788 'picture' => $request->request->get('preview_picture'),
779 'publishedAt' => $request->request->get('published_at'), 789 'publishedAt' => $request->request->get('published_at'),
780 'authors' => $request->request->get('authors', ''), 790 'authors' => $request->request->get('authors', ''),
791 'origin_url' => $request->request->get('origin_url', ''),
781 ]; 792 ];
782 } 793 }
783 794