mirror of
https://github.com/wallabag/wallabag.git
synced 2025-09-15 18:57:05 +00:00
relation between tags and entries
This commit is contained in:
parent
6c87418ff0
commit
46bbd8d321
7 changed files with 60 additions and 148 deletions
|
@ -120,11 +120,8 @@ class Entry
|
|||
private $user;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToMany(targetEntity="Tag", inversedBy="entries", cascade={"persist", "merge"})
|
||||
* @ORM\JoinTable(name="tags_entries",
|
||||
* joinColumns={@ORM\JoinColumn(name="entry_id", referencedColumnName="id")},
|
||||
* inverseJoinColumns={@ORM\JoinColumn(name="tag_id", referencedColumnName="id")}
|
||||
* )
|
||||
* @ORM\ManyToMany(targetEntity="Tag", inversedBy="entries", cascade={"persist"})
|
||||
* @ORM\JoinTable(name="entry_tags")
|
||||
*/
|
||||
private $tags;
|
||||
|
||||
|
@ -407,5 +404,6 @@ class Entry
|
|||
public function addTag(Tag $tag)
|
||||
{
|
||||
$this->tags[] = $tag;
|
||||
$tag->addEntry($this);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue