Completed
Push — master ( 9107b2...4da1f4 )
by Paweł
19s
created

ArticlesAwareTrait::setArticles()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of the Superdesk Web Publisher Content Bundle.
5
 *
6
 * Copyright 2017 Sourcefabric z.ú. and contributors.
7
 *
8
 * For the full copyright and license information, please see the
9
 * AUTHORS and LICENSE files distributed with this source code.
10
 *
11
 * @copyright 2017 Sourcefabric z.ú
12
 * @license http://www.superdesk.org/license
13
 */
14
15
namespace SWP\Bundle\ContentBundle\Model;
16
17
use Doctrine\Common\Collections\Collection;
18
19
trait ArticlesAwareTrait
20
{
21
    /**
22
     * @var Collection
23
     */
24
    protected $articles;
25
26
    /**
27
     * @return Collection
28
     */
29
    public function getArticles(): Collection
30
    {
31
        return $this->articles;
32
    }
33
34
    /**
35
     * @param Collection $articles
36
     */
37
    public function setArticles(Collection $articles): void
38
    {
39
        $this->articles = $articles;
40
    }
41
42
    /**
43
     * @param ArticleInterface $article
44
     */
45
    public function addArticle(ArticleInterface $article): void
46
    {
47
        $this->articles->add($article);
48
    }
49
}
50