Authors.php
10 months ago
Categories.php
10 months ago
DeviceBrowsers.php
10 months ago
DeviceOperatingSystems.php
10 months ago
DeviceTypes.php
10 months ago
LinkPatterns.php
10 months ago
PageTypes.php
10 months ago
ReferrerTypes.php
10 months ago
LinkPatterns.php
20 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 LinkPatterns implements OptionsPlugin |
| 11 | { |
| 12 | public function get_options() : array |
| 13 | { |
| 14 | $records = Illuminate_Builder::new()->from(Tables::link_rules())->select('link_rule_id', 'name')->get()->all(); |
| 15 | return \array_map(function ($record) { |
| 16 | return new Option($record->link_rule_id, $record->name); |
| 17 | }, $records); |
| 18 | } |
| 19 | } |
| 20 |