Exemplo n.º 1
0
 /**
  * @param Article $article
  */
 public function addArticle(Article $article)
 {
     if (!$this->hasArticle($article)) {
         $this->articles->add($article);
     }
     return $this;
 }
Exemplo n.º 2
0
 /**
  * @param Tag $tag
  */
 public function addTag(Tag $tag)
 {
     if (!$this->tags->contains($tag)) {
         $tag->setNews($this);
         $this->tags->add($tag);
     }
 }
Exemplo n.º 3
0
 /**
  * Add tags
  * @param Collection|Tag[] $tags
  * @return self
  */
 public function addTags(Collection $tags)
 {
     foreach ($tags as $tag) {
         $this->tags->add($tag);
     }
     return $this;
 }
Exemplo n.º 4
0
 /**
  * @param $tag
  * @return Article
  */
 public function addTag(Tag $tag)
 {
     if (!$this->hasTag($tag)) {
         $tag->addArticle($this);
         $this->tags->add($tag);
     }
     return $this;
 }
Exemplo n.º 5
0
Arquivo: Book.php Projeto: 7rin0/SF3
 /**
  * @param Tag $tag
  */
 public function addTag(Tag $tag)
 {
     $this->tags->add($tag);
 }
Exemplo n.º 6
0
 /**
  * @param Tag $tag
  * @return Article
  */
 public function addTag(Tag $tag)
 {
     if (!$this->tags->contains($tag)) {
         $this->tags->add($tag);
     }
     return $this;
 }