Completed
Push — master ( 91fdab...75a7b9 )
by
unknown
13:37
created

ArticleBundle/Entity/AbstractArticlePage.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\ArticleBundle\Form\AbstractArticlePageAdminType;
7
use Kunstmaan\ArticleBundle\PagePartAdmin\AbstractArticlePagePagePartAdminConfigurator;
8
use Kunstmaan\NodeBundle\Entity\AbstractPage;
9
use Kunstmaan\PagePartBundle\Helper\HasPagePartsInterface;
10
use Symfony\Component\Form\AbstractType;
11
12
abstract class AbstractArticlePage extends AbstractPage implements HasPagePartsInterface
13
{
14
    /**
15
     * The article's date, set automatically to 'now' before persisting when empty
16
     *
17
     * @var \DateTime
18
     *
19
     * @ORM\Column(type="datetime")
20
     */
21
    protected $date;
22
23
    /**
24
     * @var string
25
     *
26
     * @ORM\Column(name="summary", type="text", nullable=true)
27
     */
28
    protected $summary;
29
30
    /**
31
     * Return the date of this article
32
     * @param \DateTime $date
33
     */
34
    public function setDate($date)
35
    {
36
        $this->date = $date;
37
    }
38
39
    /**
40
     * Set the date of the article
41
     * @return \DateTime
42
     */
43
    public function getDate()
44
    {
45
        return $this->date;
46
    }
47
48
    /**
49
     * Set the summary of this article
50
     * @param $summary
51
     */
52
    public function setSummary($summary)
53
    {
54
        $this->summary = $summary;
55
    }
56
57
    /**
58
     * Returns the summary of this article
59
     *
60
     * @return string
61
     */
62
    public function getSummary()
63
    {
64
        return $this->summary;
65
    }
66
67
    /**
68
     * @return array
69
     */
70
    public function getPossibleChildTypes()
71
    {
72
        return array();
73
    }
74
75
    /**
76
     * {@inheritdoc}
77
     */
78
    public function getDefaultAdminType()
79
    {
80
        return AbstractArticlePageAdminType::class;
81
    }
82
83
    public function getAdminType()
84
    {
85
        return $this->getDefaultAdminType();
86
    }
87
88
    /**
89
     * @return array
0 ignored issues
show
Consider making the return type a bit more specific; maybe use AbstractArticlePagePagePartAdminConfigurator[].

This check looks for the generic type array as a return type and suggests a more specific type. This type is inferred from the actual code.

Loading history...
90
     */
91
    public function getPagePartAdminConfigurations()
92
    {
93
        return array(new AbstractArticlePagePagePartAdminConfigurator());
94
    }
95
}
96