Authors.php
9 months ago
Categories.php
9 months ago
Countries.php
6 months ago
DeviceBrowsers.php
9 months ago
DeviceOperatingSystems.php
9 months ago
DeviceTypes.php
9 months ago
FormConversions.php
6 months ago
LinkPatternConversions.php
6 months ago
LinkPatterns.php
9 months ago
PageTypes.php
9 months ago
ReferrerTypes.php
9 months ago
LinkPatternConversions.php
22 lines
| 1 | <?php |
| 2 | |
| 3 | namespace IAWP\ColumnOptions\Plugins; |
| 4 | |
| 5 | use IAWP\ColumnOptions\Option; |
| 6 | use IAWP\ColumnOptions\OptionsPlugin; |
| 7 | use IAWP\Illuminate_Builder; |
| 8 | use IAWP\Tables; |
| 9 | /** @internal */ |
| 10 | class LinkPatternConversions implements OptionsPlugin |
| 11 | { |
| 12 | public function get_options() : array |
| 13 | { |
| 14 | $any = new Option('is_not_null', \__('Any', 'independent-analytics')); |
| 15 | $records = Illuminate_Builder::new()->from(Tables::link_rules())->select('link_rule_id', 'name')->get()->all(); |
| 16 | $link_pattern_options = \array_map(function ($record) { |
| 17 | return new Option($record->link_rule_id, $record->name); |
| 18 | }, $records); |
| 19 | return [$any, ...$link_pattern_options]; |
| 20 | } |
| 21 | } |
| 22 |