ProductTypeTrait.php in Commerce Migrate 3.1.x
File
modules/ubercart/src/Plugin/migrate/source/uc7/ProductTypeTrait.php
View source
<?php
namespace Drupal\commerce_migrate_ubercart\Plugin\migrate\source\uc7;
trait ProductTypeTrait {
protected $productTypes = [];
protected function getProductTypes() {
if (!empty($this->productTypes)) {
return $this->productTypes;
}
$query = $this
->select('node_type', 'nt')
->fields('nt', [
'type',
])
->condition('module', 'uc_product%', 'LIKE')
->distinct();
$this->productTypes = [
$query
->execute()
->fetchCol(),
];
return reset($this->productTypes);
}
}