1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-10-15 19:42:08 +00:00

Fix PATCH method

The PATCH method for the entry should only update what user sent to us and not the whole entry as it was before.
Also, sending tags when patching an entry will now remove all current tags & assocatied new ones.
This commit is contained in:
Jeremy Benoist 2017-06-30 16:54:26 +02:00
parent 71e1cbc8eb
commit a05b61159e
No known key found for this signature in database
GPG key ID: BCA73962457ACC3C
5 changed files with 270 additions and 121 deletions

View file

@ -593,6 +593,11 @@ class Entry
$tag->addEntry($this);
}
/**
* Remove the given tag from the entry (if the tag is associated).
*
* @param Tag $tag
*/
public function removeTag(Tag $tag)
{
if (!$this->tags->contains($tag)) {
@ -603,6 +608,17 @@ class Entry
$tag->removeEntry($this);
}
/**
* Remove all assigned tags from the entry.
*/
public function removeAllTags()
{
foreach ($this->tags as $tag) {
$this->tags->removeElement($tag);
$tag->removeEntry($this);
}
}
/**
* Set previewPicture.
*