/**
  * Export the missing properties
  */
 protected function doExport()
 {
     $propertyGroupRepository = Shopware()->Models()->getRepository('Shopware\\Models\\Property\\Group');
     /** @var Shopware\Models\Property\Group $PropertyGroup */
     foreach ($propertyGroupRepository->findAll() as $PropertyGroup) {
         try {
             $groupIdAdded = PlentymarketsMappingController::getPropertyGroupByShopwareID($PropertyGroup->getId());
         } catch (PlentymarketsMappingExceptionNotExistant $E) {
             if (array_key_exists($PropertyGroup->getName(), $this->PLENTY_groupName2ID)) {
                 $groupIdAdded = $this->PLENTY_groupName2ID[$PropertyGroup->getName()];
             } else {
                 $Request_SetPropertyGroups = new PlentySoapRequest_SetPropertyGroups();
                 $Request_SetPropertyGroups->Properties = array();
                 $Object_SetPropertyGroup = new PlentySoapObject_SetPropertyGroup();
                 $Object_SetPropertyGroup->BackendName = $PropertyGroup->getName();
                 $Object_SetPropertyGroup->FrontendName = $PropertyGroup->getName();
                 $Object_SetPropertyGroup->Lang = 'de';
                 $Object_SetPropertyGroup->PropertyGroupID = null;
                 $Request_SetPropertyGroups->PropertyGroups[] = $Object_SetPropertyGroup;
                 $Response = PlentymarketsSoapClient::getInstance()->SetPropertyGroups($Request_SetPropertyGroups);
                 if (!$Response->Success) {
                     throw new PlentymarketsExportException('The item property group »' . $Object_SetPropertyGroup->BackendName . '« could not be exported', 2941);
                 }
                 $groupIdAdded = (int) $Response->ResponseMessages->item[0]->SuccessMessages->item[0]->Value;
             }
             PlentymarketsMappingController::addPropertyGroup($PropertyGroup->getId(), $groupIdAdded);
             // do export for property group translation
             $this->exportPropertyGroupTranslations($PropertyGroup->getId(), $groupIdAdded);
         }
         if (!isset($this->PLENTY_groupIDValueName2ID[$groupIdAdded])) {
             $this->PLENTY_groupIDValueName2ID[$groupIdAdded] = array();
         }
         /** @var Shopware\Models\Property\Option $Property */
         foreach ($PropertyGroup->getOptions() as $Property) {
             $Request_SetProperties = new PlentySoapRequest_SetProperties();
             $Request_SetProperties->Properties = array();
             $Object_SetProperty = new PlentySoapObject_SetProperty();
             $Object_SetProperty->PropertyGroupID = $groupIdAdded;
             $Object_SetProperty->PropertyID = null;
             $Object_SetProperty->Lang = 'de';
             $shopwareID = $PropertyGroup->getId() . ';' . $Property->getId();
             try {
                 PlentymarketsMappingController::getPropertyByShopwareID($shopwareID);
             } catch (PlentymarketsMappingExceptionNotExistant $E) {
                 if (array_key_exists($Property->getName(), $this->PLENTY_groupIDValueName2ID[$groupIdAdded])) {
                     $propertyIdAdded = $this->PLENTY_groupIDValueName2ID[$groupIdAdded][$Property->getName()];
                 } else {
                     $Object_SetProperty->PropertyFrontendName = $Property->getName();
                     $Object_SetProperty->PropertyBackendName = $Property->getName();
                     $Object_SetProperty->ShowOnItemPage = 1;
                     $Object_SetProperty->ShowInItemList = 1;
                     $Object_SetProperty->PropertyType = 'text';
                     $Request_SetProperties->Properties[] = $Object_SetProperty;
                     $Response_SetProperties = PlentymarketsSoapClient::getInstance()->SetProperties($Request_SetProperties);
                     if (!$Response_SetProperties->Success) {
                         throw new PlentymarketsExportException('The item property »' . $Object_SetProperty->PropertyBackendName . '« could not be created', 2942);
                     }
                     $propertyIdAdded = (int) $Response_SetProperties->ResponseMessages->item[0]->SuccessMessages->item[0]->Value;
                 }
                 PlentymarketsMappingController::addProperty($shopwareID, $propertyIdAdded);
                 $this->exportPropertyTranslations($groupIdAdded, $Property->getId(), $propertyIdAdded);
             }
         }
     }
 }