base-list-box.php
36 lines
| 1 | <?php |
| 2 | |
| 3 | |
| 4 | namespace Jet_Form_Builder\Admin\Single_Pages\Meta_Boxes; |
| 5 | |
| 6 | use Jet_Form_Builder\Admin\Table_Advanced_Record_Prepare_Trait; |
| 7 | |
| 8 | abstract class Base_List_Box extends Base_Meta_Box { |
| 9 | |
| 10 | use Table_Advanced_Record_Prepare_Trait; |
| 11 | |
| 12 | final public function get_values(): array { |
| 13 | return $this->prepare_record( $this->get_list() ); |
| 14 | } |
| 15 | |
| 16 | public function get_raw_list( array $args ): array { |
| 17 | return array(); |
| 18 | } |
| 19 | |
| 20 | public function get_single(): array { |
| 21 | return array(); |
| 22 | } |
| 23 | |
| 24 | public function to_array(): array { |
| 25 | return array_merge( |
| 26 | parent::to_array(), |
| 27 | array( |
| 28 | 'columns' => $this->get_columns_headings(), |
| 29 | 'single_endpoint' => $this->get_single(), |
| 30 | 'render_type' => self::TYPE_LIST, |
| 31 | ) |
| 32 | ); |
| 33 | } |
| 34 | |
| 35 | } |
| 36 |