Completed
Push — master ( 6e92d2...d7f3a5 )
by
unknown
109:07 queued 86:32
created

ArticleBundle/Entity/AbstractCategory.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 Gedmo\Mapping\Annotation as Gedmo;
7
use Gedmo\Translatable\Translatable;
8
use Kunstmaan\AdminBundle\Entity\AbstractEntity;
9
use Symfony\Component\Validator\Constraints as Assert;
10
11 View Code Duplication
class AbstractCategory extends AbstractEntity implements Translatable
0 ignored issues
show
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
12
{
13
    /**
14
     * AbstractCategory constructor.
15
     */
16
    public function __construct()
17
    {
18
        if (get_class($this) === AbstractCategory::class) {
19
            trigger_error('Please extend this class, it will be made abstract in 6.0.', E_USER_DEPRECATED);
20
        }
21
    }
22
23
    /**
24
     * @var string
25
     *
26
     * @ORM\Column(name="name", type="string", length=255)
27
     * @Assert\NotBlank()
28
     * @Gedmo\Translatable
29
     */
30
    protected $name;
31
32
    /**
33
     * @Gedmo\Locale
34
     */
35
    protected $locale;
36
37
    /**
38
     * @var \DateTime
39
     *
40
     * @ORM\Column(name="deleted_at", type="datetime", nullable=true)
41
     */
42
    protected $deletedAt;
43
44
45
    /**
46
     * Set name
47
     *
48
     * @param string $name
49
     */
50
    public function setName($name)
51
    {
52
        $this->name = $name;
53
    }
54
55
    /**
56
     * Get name
57
     *
58
     * @return string
59
     */
60
    public function getName()
61
    {
62
        return $this->name;
63
    }
64
65
    /**
66
     * @return mixed
67
     */
68
    public function getLocale()
69
    {
70
        return $this->locale;
71
    }
72
73
    /**
74
     * @param mixed $locale
75
     */
76
    public function setLocale($locale)
77
    {
78
        $this->locale = $locale;
79
    }
80
81
    /**
82
     * @return \DateTime
83
     */
84
    public function getDeletedAt()
85
    {
86
        return $this->deletedAt;
87
    }
88
89
    /**
90
     * @param \DateTime $deletedAt
91
     */
92
    public function setDeletedAt($deletedAt)
93
    {
94
        $this->deletedAt = $deletedAt;
95
    }
96
97
    /**
98
     * @return string
99
     */
100
    public function __toString()
101
    {
102
        return $this->getName();
103
    }
104
}
105
106