Yuki 在 2020-11-13 10:24 星期五 提交
在开发中经常遇到需要导出导入的情况,在drupal中使用 feeds
与 views_data_export
两个模块配合
定义 feeds
插件
hook_feeds_plugins
Yuki 在 2020-11-04 10:04 星期三 提交
<?php
namespace Drupal\ew_cargo_plan\Plugins;
use Drupal\ew_cargo_plan\Entity\EwCargoPlan;
use Drupal\ew_channel\Entity\EwChannel;
use Drupal\ew_product\Entity\EwProduct;
use Drupal\ew_product_stock\Entity\EwProductStock;
use FeedsParserResult;
use FeedsProcessor;
use FeedsSource;
class EwCargoPlanFeedsProcessor extends FeedsProcessor {
protected $channel_id = '';
protected $product_id = '';
public function getMappingTargets() {
$targets = parent::getMappingTargets();
$targets['id'] = [
'name' => t('ID'),
'optional_unique' => TRUE,
Yuki 在 2019-09-01 11:48 星期日 提交
在drupal中使用feeds导入数据。
如果需要导入的数据是自定义的 entity 就需要写导入插件。
使用下面的 hook 定义解析器