Completed
Push — petrabarus-widget-event ( beac23 )
by Alexander
38:33
created

WidgetEvent::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
/**
3
 * @link http://www.yiiframework.com/
4
 * @copyright Copyright (c) 2008 Yii Software LLC
5
 * @license http://www.yiiframework.com/license/
6
 */
7
8
namespace yii\base;
9
10
/**
11
 * WidgetEvent represents the event parameter used for a widget event.
12
 *
13
 * By setting the [[isValid]] property, one may control whether to continue running the widget.
14
 *
15
 * @author Petra Barus <[email protected]>
16
 * @since 2.0.11
17
 */
18
class WidgetEvent extends Event {
19
    
20
    /**
21
     * @var Widget the widget currently being executed
22
     */
23
    public $widget;
24
    /**
25
     * @var mixed the widget result. Event handlers may modify this property to change the widget result.
26
     */
27
    public $result;
28
    /**
29
     * @var boolean whether to continue running the widget. Event handlers of
30
     * [[Widget::EVENT_BEFORE_RUN]] may set this property to decide whether
31
     * to continue running the current widget.
32
     */
33
    public $isValid = true;
34
35
36
    /**
37
     * Constructor.
38
     * @param Widget $widget the widget associated with this widget event.
39
     * @param array $config name-value pairs that will be used to initialize the object properties
40
     */
41
    public function __construct($widget, $config = [])
42
    {
43
        $this->widget = $widget;
44
        parent::__construct($config);
45
    }
46
}
47