/**
     * Get the mapping data: shops
     *
     * @return array
     */
    public function getShops()
    {
        $rows = Shopware()->Db()->query('
					SELECT
							C.id, C.name, C.`default`,
							IFNULL(PMC.plentyID, -1) plentyID
						FROM s_core_shops C
						LEFT JOIN plenty_mapping_shop PMC
							ON PMC.shopwareID = C.id
						WHERE active = 1 
						ORDER BY C.name
				')->fetchAll();
        $plentyStores = PlentymarketsImportController::getStoreList();
        foreach ($rows as &$row) {
            if ($row['plentyID'] >= 0) {
                $row['plentyName'] = $plentyStores[$row['plentyID']]['name'];
            } else {
                if ($this->auto) {
                }
            }
            if ($row['default']) {
                $row['name'] .= ' (Standard)';
            }
        }
        return $rows;
    }
 /**
  * Loads the multishop list data
  */
 public function getMultishopListAction()
 {
     $this->View()->assign(array('success' => true, 'data' => array_values(PlentymarketsImportController::getStoreList())));
 }
 /**
  * Runs the mapping cleanup cronjob.
  *
  * @param Shopware_Components_Cron_CronJob $Job
  */
 public function runMappingCleanup(Shopware_Components_Cron_CronJob $Job)
 {
     // Check the connection
     if (!$this->Status->mayImport()) {
         return;
     }
     PlentymarketsLogger::getInstance()->message('Cleanup:Mapping', 'Starting');
     // Reset the timestamps
     PlentymarketsConfig::getInstance()->setMiscCustomerClassLastImport(0);
     PlentymarketsConfig::getInstance()->setMiscMethodsOfPaymentLastImport(0);
     PlentymarketsConfig::getInstance()->setMiscSalesOrderReferrerLastImport(0);
     PlentymarketsConfig::getInstance()->setMiscShippingProfilesLastImport(0);
     PlentymarketsConfig::getInstance()->setMiscMultishopsLastImport(0);
     PlentymarketsConfig::getInstance()->setMiscVatLastImport(0);
     // Get fresh data
     PlentymarketsImportController::getCustomerClassList();
     PlentymarketsImportController::getMethodOfPaymentList();
     PlentymarketsImportController::getOrderReferrerList();
     PlentymarketsImportController::getShippingProfileList();
     PlentymarketsImportController::getStoreList();
     PlentymarketsImportController::getVatList();
     PlentymarketsLogger::getInstance()->message('Cleanup:Mapping', 'Finished');
 }