GuestListGridFieldConfig::__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 2
1
<?php
2
3
namespace Broarm\EventTickets;
4
5
use CalendarEvent;
6
use GridFieldAddNewButton;
7
use GridFieldConfig_RecordEditor;
8
9
/**
10
 * Class GuestListGridFieldConfig
11
 *
12
 * @author Bram de Leeuw
13
 * @package Broarm\EventTickets
14
 */
15
class GuestListGridFieldConfig extends ReservationGridFieldConfig
16
{
17
    /**
18
     * GuestListGridFieldConfig constructor.
19
     * @param CalendarEvent|TicketExtension $event
20
     * @param null $itemsPerPage
21
     */
22
    public function __construct(CalendarEvent $event, $itemsPerPage = null)
23
    {
24
        parent::__construct($itemsPerPage);
25
        $this->addComponent(new GridFieldAddNewButton('buttons-before-left'));
26
        $this->addComponent(new GuestListExportButton('buttons-before-left', $event->Fields()->map()->toArray()));
27
        $this->extend('updateGuestListConfig', $event);
28
    }
29
}
30