Completed
Push — master ( 1de9b7...830752 )
by Kristof
38:46 queued 24:09
created

Kunstmaan/ArticleBundle/Entity/AbstractAuthor.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace Kunstmaan\ArticleBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use Kunstmaan\AdminBundle\Entity\AbstractEntity;
7
8
/**
9
 * Class AbstractAuthor
10
 */
11
class AbstractAuthor extends AbstractEntity
12
{
13
    /**
14
     * AbstractAuthor constructor.
15
     */
16
    public function __construct()
17
    {
18
        if (get_class($this) === AbstractAuthor::class) {
19
            @trigger_error('Instantiating the "%s" class is deprecated in KunstmaanArticleBundle 5.1 and will be made abstract in KunstmaanArticleBundle 6.0. Extend your implementation from this class instead.', E_USER_DEPRECATED);
0 ignored issues
show
Security Best Practice introduced by
It seems like you do not handle an error condition here. This can introduce security issues, and is generally not recommended.

If you suppress an error, we recommend checking for the error condition explicitly:

// For example instead of
@mkdir($dir);

// Better use
if (@mkdir($dir) === false) {
    throw new \RuntimeException('The directory '.$dir.' could not be created.');
}
Loading history...
20
        }
21
    }
22
23
    /**
24
     * @var string
25
     *
26
     * @ORM\Column(type="string", nullable=false, name="name")
27
     */
28
    protected $name;
29
30
    /**
31
     * @var string
32
     *
33
     * @ORM\Column(type="string", nullable=true, name="link")
34
     */
35
    protected $link;
36
37
    /**
38
     * @param string $name
39
     */
40
    public function setName($name)
41
    {
42
        $this->name = $name;
43
    }
44
45
    /**
46
     * @return string
47
     */
48
    public function getName()
49
    {
50
        return $this->name;
51
    }
52
53
    /**
54
     * @param $link
55
     */
56
    public function setLink($link)
57
    {
58
        $this->link = $link;
59
    }
60
61
    /**
62
     * @return string
63
     */
64
    public function getLink()
65
    {
66
        return $this->link;
67
    }
68
69
    /**
70
     * @return string
71
     */
72
    public function __toString()
73
    {
74
        return $this->getName();
75
    }
76
}
77