From 61351218f90df455c6edcc530bfc746d60b43a12 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Fri, 24 Feb 2017 11:34:36 +0100 Subject: Save changes PHP CS Fixed Events on changes Renamed field First draft for migration (create table Change) Added setter for tag in EntryTaggedEvent Fixed migration for Change table Added API route for entry history Removed deletion history --- src/Wallabag/CoreBundle/Entity/Change.php | 86 +++++++++++++++++++++++++++++++ src/Wallabag/CoreBundle/Entity/Entry.php | 6 +++ 2 files changed, 92 insertions(+) create mode 100644 src/Wallabag/CoreBundle/Entity/Change.php (limited to 'src/Wallabag/CoreBundle/Entity') diff --git a/src/Wallabag/CoreBundle/Entity/Change.php b/src/Wallabag/CoreBundle/Entity/Change.php new file mode 100644 index 00000000..203a2d31 --- /dev/null +++ b/src/Wallabag/CoreBundle/Entity/Change.php @@ -0,0 +1,86 @@ +type = $type; + $this->entry = $entry; + $this->createdAt = new \DateTime(); + } + + /** + * @return int + */ + public function getId() + { + return $this->id; + } + + /** + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * @return DateTime + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + * @return Entry + */ + public function getEntry() + { + return $this->entry; + } +} diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index 08a67c34..a24409b9 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php @@ -233,6 +233,11 @@ class Entry */ private $tags; + /** + * @ORM\OneToMany(targetEntity="Wallabag\CoreBundle\Entity\Change", mappedBy="entry", cascade={"remove"}) + */ + private $changes; + /* * @param User $user */ @@ -240,6 +245,7 @@ class Entry { $this->user = $user; $this->tags = new ArrayCollection(); + $this->changes = new ArrayCollection(); } /** -- cgit v1.2.3