Total Complexity | 3 |
Total Lines | 35 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | <?php |
||
20 | class PurifyBehavior extends Behavior |
||
21 | { |
||
22 | /** |
||
23 | * @var array attributes |
||
24 | */ |
||
25 | public $attributes = []; |
||
26 | /** |
||
27 | * @var null The config to use for HtmlPurifier |
||
28 | */ |
||
29 | public $config = null; |
||
30 | |||
31 | /** |
||
32 | * Declares event handlers for the [[owner]]'s events. |
||
33 | * |
||
34 | * Child classes may override this method to declare what PHP callbacks should |
||
35 | * be attached to the events of the [[owner]] component. |
||
36 | * |
||
37 | * The callbacks will be attached to the [[owner]]'s events when the behavior is |
||
38 | * attached to the owner; and they will be detached from the events when |
||
39 | * the behavior is detached from the component. |
||
40 | **/ |
||
41 | public function events() |
||
42 | { |
||
43 | return [ |
||
44 | ActiveRecord::EVENT_BEFORE_VALIDATE => 'beforeValidate', |
||
45 | ]; |
||
46 | } |
||
47 | |||
48 | /** |
||
49 | * Before validate event. |
||
50 | */ |
||
51 | public function beforeValidate() |
||
55 | } |
||
56 | } |
||
58 |