inpsyde / wpml2mlp

Convert posts from an existing WPML multilingual site via WXR Export/Import for MultilingualPress
https://wordpress.org/plugins/wpml-to-multilingualpress/
GNU General Public License v2.0
10 stars 6 forks source link

Split Service\ObjectImporterInterface into generic type importers #36

Closed dnaber-de closed 8 years ago

dnaber-de commented 8 years ago

Currently there's the Service\ObjectImporterInterface with the methods import_post() and import_term() (and later there would have been import_author().

For many reasons it makes more sense to split these interface into three separate ones:

namespace W2M\Import\Service;

use 
    W2M\Import\Type;

interface PostImporterInterface {

    public function import_post( Type\ImportPostInterface $post );
}
namespace W2M\Import\Service;

use 
    W2M\Import\Type;

interface TermImporterInterface {

    public function import_post( Type\ImportTermInterface $term );
}
namespace W2M\Import\Service;

use 
    W2M\Import\Type;

interface UserImporterInterface {

    public function import_post( Type\ImportUserInterface $post );
}

The implementations should have the names WpPostImporter, WpTermImporter and WpUserImporter.