BlockMarkup
6 days ago
CSS
6 days ago
DataFormatConsumer
6 days ago
DataFormatProducer
6 days ago
EntityReader
6 days ago
EntityWriter
6 days ago
Importer
6 days ago
URL
6 days ago
vendor-patched
6 days ago
LICENSE.md
6 days ago
README.md
6 days ago
class-dataliberationexception.php
6 days ago
class-dataliberationhtmlprocessor.php
6 days ago
class-importentity.php
6 days ago
composer.json
6 days ago
rector.php
6 days ago
class-importentity.php
67 lines
| 1 | <?php |
| 2 | |
| 3 | namespace WordPress\DataLiberation; |
| 4 | |
| 5 | /** |
| 6 | * Represents a single entity, whether a WordPress post, post meta, |
| 7 | * a single SQL record, or something entirely different. |
| 8 | */ |
| 9 | class ImportEntity { |
| 10 | |
| 11 | const TYPE_POST = 'post'; |
| 12 | const TYPE_POST_META = 'post_meta'; |
| 13 | const TYPE_COMMENT = 'comment'; |
| 14 | const TYPE_COMMENT_META = 'comment_meta'; |
| 15 | const TYPE_TERM = 'term'; |
| 16 | const TYPE_TAG = 'tag'; |
| 17 | const TYPE_CATEGORY = 'category'; |
| 18 | const TYPE_USER = 'user'; |
| 19 | const TYPE_SITE_OPTION = 'site_option'; |
| 20 | |
| 21 | const POST_FIELDS = array( |
| 22 | 'post_title', |
| 23 | 'link', |
| 24 | 'guid', |
| 25 | 'post_excerpt', |
| 26 | 'post_published_at', |
| 27 | 'post_author', |
| 28 | 'post_content', |
| 29 | 'post_excerpt', |
| 30 | 'post_id', |
| 31 | 'post_status', |
| 32 | 'post_date', |
| 33 | 'post_date_gmt', |
| 34 | 'post_modified', |
| 35 | 'post_modified_gmt', |
| 36 | 'comment_status', |
| 37 | 'ping_status', |
| 38 | 'post_name', |
| 39 | 'post_parent', |
| 40 | 'menu_order', |
| 41 | 'post_type', |
| 42 | 'post_password', |
| 43 | 'is_sticky', |
| 44 | 'attachment_url', |
| 45 | ); |
| 46 | |
| 47 | private $type; |
| 48 | private $data; |
| 49 | |
| 50 | public function __construct( $type, $data ) { |
| 51 | $this->type = $type; |
| 52 | $this->data = $data; |
| 53 | } |
| 54 | |
| 55 | public function get_type() { |
| 56 | return $this->type; |
| 57 | } |
| 58 | |
| 59 | public function get_data() { |
| 60 | return $this->data; |
| 61 | } |
| 62 | |
| 63 | public function set_data( $data ) { |
| 64 | $this->data = $data; |
| 65 | } |
| 66 | } |
| 67 |