interface-importer.php
| 1 | <?php |
| 2 | /** |
| 3 | * This interface defines a contract for implementing importers. |
| 4 | * |
| 5 | * @package AdvancedAds |
| 6 | * @author Advanced Ads <info@wpadvancedads.com> |
| 7 | * @since 1.47.0 |
| 8 | */ |
| 9 | |
| 10 | namespace AdvancedAds\Interfaces; |
| 11 | |
| 12 | defined( 'ABSPATH' ) || exit; |
| 13 | |
| 14 | /** |
| 15 | * Interface for Importers. |
| 16 | */ |
| 17 | interface Importer { |
| 18 | |
| 19 | /** |
| 20 | * Get the unique identifier (ID) of the importer. |
| 21 | * |
| 22 | * @return string The unique ID of the importer. |
| 23 | */ |
| 24 | public function get_id(): string; |
| 25 | |
| 26 | /** |
| 27 | * Get the title or name of the importer. |
| 28 | * |
| 29 | * @return string The title of the importer. |
| 30 | */ |
| 31 | public function get_title(): string; |
| 32 | |
| 33 | /** |
| 34 | * Get a description of the importer. |
| 35 | * |
| 36 | * @return string The description of the importer. |
| 37 | */ |
| 38 | public function get_description(): string; |
| 39 | |
| 40 | /** |
| 41 | * Get the icon to this importer. |
| 42 | * |
| 43 | * @return string The icon for the importer. |
| 44 | */ |
| 45 | public function get_icon(): string; |
| 46 | |
| 47 | /** |
| 48 | * Detect the importer in database. |
| 49 | * |
| 50 | * @return bool True if detected; otherwise, false. |
| 51 | */ |
| 52 | public function detect(): bool; |
| 53 | |
| 54 | /** |
| 55 | * Render form. |
| 56 | * |
| 57 | * @return void |
| 58 | */ |
| 59 | public function render_form(): void; |
| 60 | |
| 61 | /** |
| 62 | * Import data. |
| 63 | * |
| 64 | * @return WP_Error|string |
| 65 | */ |
| 66 | public function import(); |
| 67 | } |
| 68 |