protected function importTaxonomyTerms() {
    $data = $this->loadDataArray('taxonomy');
    if (!empty($data)) {

      $uuids = [];

      foreach ($data as $item) {

        // Prepare content.
        $values = [
          'vid' => $item['vid'],
          'name' => $item['name'],
        ];

        // Set author.
        $values['uid'] = 1;

        // Create Media.
        $entity = $this->entityTypeManager->getStorage('taxonomy_term')->create($values);
        $entity->save();
        $uuids[$entity->uuid()] = 'taxonomy_term';
      }
      $this->storeCreatedContentUuids($uuids);
    }
    return $this;
  }
protected function importTaxonomyTerms() {
    $data = $this->loadDataArray('taxonomy');
    if (!empty($data)) {

      $uuids = [];

      foreach ($data as $item) {

        // Prepare content.
        $values = [
          'vid' => $item['vid'],
          'name' => $item['name'],
        ];

        // Set author.
        $values['uid'] = 1;

        // Create Media.
        $entity = $this->entityTypeManager->getStorage('taxonomy_term')->create($values);
        $entity->save();
        $uuids[$entity->uuid()] = 'taxonomy_term';
      }
      $this->storeCreatedContentUuids($uuids);
    }
    return $this;
  }
protected function importTaxonomyTerms ( ) { $ data = $ this -> loadDataArray ( 'taxonomy' ) ; if ( ! empty ( $ data ) ) { $ uuids = [ ] ; foreach ( $ data as $ item ) { // Prepare content. $ values = [ 'vid' => $ item [ 'vid' ] , 'name' => $ item [ 'name' ] , ] ; // Set author. $ values [ 'uid' ] = 1 ; // Create Media. $ entity = $ this -> entityTypeManager -> getStorage ( 'taxonomy_term' ) -> create ( $ values ) ; $ entity -> save ( ) ; $ uuids [ $ entity -> uuid ( ) ] = 'taxonomy_term' ; } $ this -> storeCreatedContentUuids ( $ uuids ) ; } return $ this ; }
Import taxonomy terms.
Import taxonomy terms .