PHP code example of sp4tz / abacus-xml-exporter

1. Go to this page and download the library: Download sp4tz/abacus-xml-exporter library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

sp4tz / abacus-xml-exporter example snippets


$config = new AbacusXmlExportConfig(
    mandant: '123456',
);

use AbaConnect\Abacus\Mapper\TimesheetEntryMapperInterface;
use AbaConnect\Abacus\Mapper\ArrayTimesheetEntryMapper;

/** @var TimesheetEntryMapperInterface $mapper */
$mapper = new ArrayTimesheetEntryMapper();



declare(strict_types=1);

use AbaConnect\Abacus\Dto\TimesheetEntry;
use AbaConnect\Abacus\Export\AbacusXmlExportConfig;
use AbaConnect\Abacus\Export\AbacusXmlExporter;

      amount: 8.5,
        factor: 1,
        costCentre1: 200,
        textPayrollType: 'Texte paie',
    ),
];

$exporter = new AbacusXmlExporter();
$config = new AbacusXmlExportConfig();

echo $exporter->exportToString($entries, $config);

try {
    $xml = $exporter->exportToString($entries, $config);
} catch (\AbaConnect\Abacus\Exception\AbacusXmlExportException $e) {
    // Log / message utilisateur
}
powershell
composer dump-autoload
powershell
php examples/plain-php.php