GridFieldConfigBlogPost::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace SilverStripe\Blog\Forms\GridField;
4
5
use SilverStripe\Core\Injector\Injector;
6
use SilverStripe\Lumberjack\Forms\GridFieldConfig_Lumberjack;
7
use SilverStripe\Lumberjack\Forms\GridFieldSiteTreeState;
8
9
/**
10
 * GridField config necessary for managing a SiteTree object.
11
 *
12
 */
13
class GridFieldConfigBlogPost extends GridFieldConfig_Lumberjack
14
{
15
    /**
16
     * @param null|int $itemsPerPage
17
     */
18
    public function __construct($itemsPerPage = null)
19
    {
20
        parent::__construct($itemsPerPage);
21
22
        $this->removeComponentsByType(GridFieldSiteTreeState::class);
23
        $this->addComponent(Injector::inst()->create(GridFieldBlogPostState::class));
24
    }
25
}
26