| 1 | <?php |
||
| 7 | abstract class Filter |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Whether or not this filter is enabled |
||
| 11 | * @var boolean |
||
| 12 | */ |
||
| 13 | protected $enabled = false; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * Set whether or not this filter is enabled |
||
| 17 | * |
||
| 18 | * @param boolean $enabled |
||
| 19 | */ |
||
| 20 | public function setEnabled($enabled) |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Is this filter enabled? |
||
| 27 | * |
||
| 28 | * @return boolean |
||
| 29 | */ |
||
| 30 | public function isEnabled() |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Does this event pass this filter? |
||
| 37 | * |
||
| 38 | * @param Event $event |
||
| 39 | * @return boolean `true` if the event passes the filter and should be |
||
| 40 | * included, `false` otherwise |
||
| 41 | */ |
||
| 42 | abstract public function filter(Event $event); |
||
| 43 | } |
||
| 44 |