add example export

This commit is contained in:
Daniel Seifert 2021-04-27 23:40:54 +02:00
parent f663697bad
commit b40558364e
Signed by: DanielS
GPG Key ID: 6A513E13AEE66170
3 changed files with 74 additions and 2 deletions

View File

@ -15,6 +15,8 @@ declare(strict_types=1);
namespace D3\DataWizard\Application\Model;
use D3\DataWizard\Application\Model\Exports\InactiveCategories;
class Configuration
{
const GROUP_CATEGORY = 'D3_DATAWIZARD_GROUP_CATEGORIES';
@ -32,7 +34,7 @@ class Configuration
public function configure()
{
$this->registerExport(self::GROUP_CATEGORY, oxNew(InactiveCategories::class));
}
/**

View File

@ -0,0 +1,68 @@
<?php
/**
* This Software is the property of Data Development and is protected
* by copyright law - it is NOT Freeware.
* Any unauthorized use of this software without a valid license
* is a violation of the license agreement and will be prosecuted by
* civil and criminal law.
* http://www.shopmodule.com
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
* @author D3 Data Development - Daniel Seifert <support@shopmodule.com>
* @link http://www.oxidmodule.com
*/
namespace D3\DataWizard\Application\Model\Exports;
use D3\DataWizard\Application\Model\ExportBase;
use OxidEsales\Eshop\Core\Registry;
class InactiveCategories extends ExportBase
{
/**
* Kategorien -deaktiviert, mit aktiven Artikel
*/
/**
* @return string
*/
public function getTitle() : string
{
return Registry::getLang()->translateString('D3_DATAWIZARD_EXPORTS_INACTIVECATEGORIES');
}
/**
* @return string
*/
public function getDescription() : string
{
return '';
}
/**
* @return array
*/
public function getQuery() : array
{
return [
"SELECT
oc.OXID,
oc.OXSHOPID,
oc.oxtitle as 'Titel',
(
SELECT GROUP_CONCAT(oxtitle ORDER BY oxleft ASC SEPARATOR ' > ')
from oxcategories
WHERE OXLEFT < oc.oxleft AND OXRIGHT > oc.oxright AND OXROOTID = oc.OXROOTID AND OXSHOPID = oc.OXSHOPID
) as 'Baum',
COUNT(oa.oxid) as 'Anzahl'
FROM oxcategories oc
LEFT JOIN oxobject2category o2c ON oc.OXID = o2c.OXCATNID
LEFT JOIN oxarticles oa ON o2c.OXOBJECTID = oa.OXID
WHERE oc.OXACTIVE = ? AND oa.OXACTIVE = ?
GROUP BY oc.oxid
ORDER BY oc.oxleft ASC",
[0, 1]
];
}
}

View File

@ -42,7 +42,9 @@ $aLang = array(
'D3_DATAWIZARD_ERR_NOEXPORTSELECT' => 'Export kann nicht ausgeführt werden. Exporte erfordern SELECT Query.',
'D3_DATAWIZARD_ERR_NOEXPORT_INSTALLED' => 'Es sind keine Exporte installiert oder aktiviert.',
'D3_DATAWIZARD_ERR_NOEXPORTCONTENT' => 'Export ist leer, kein Inhalt zum Download verfügbar',
'D3_DATAWIZARD_ERR_NOSUITABLERENDERER' => 'kein Renderer für Format "%1$s" registriert'
'D3_DATAWIZARD_ERR_NOSUITABLERENDERER' => 'kein Renderer für Format "%1$s" registriert',
'D3_DATAWIZARD_EXPORTS_INACTIVECATEGORIES' => 'deaktivierte Kategorien, mit aktiven Artikel'
// Abracadata
// Harry Potter