Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

automaticLiquidation support #49

Open
Vitexus opened this issue Nov 20, 2024 · 2 comments
Open

automaticLiquidation support #49

Vitexus opened this issue Nov 20, 2024 · 2 comments

Comments

@Vitexus
Copy link

Vitexus commented Nov 20, 2024

Is there way how to create request looks like https://www.stormware.cz/xml/samples/version_2/import/Banka/Bank_03_v2.0.xml using this library ?

Maybe i need something like src/Pohoda/Type/AutomaticLiquidationType.php ?

<?php
/**
 * This file is part of riesenia/pohoda package.
 *
 * Licensed under the MIT License
 * (c) RIESENIA.com
 */

declare(strict_types=1);

namespace Riesenia\Pohoda\Type;

use Riesenia\Pohoda\Agenda;
use Riesenia\Pohoda\Common\OptionsResolver;
use Riesenia\Pohoda\Common\SetNamespaceTrait;

class AutomaticLiquidationType extends Agenda
{
    use SetNamespaceTrait;

    /**
     * {@inheritdoc}
     */
    public function getXML(): \SimpleXMLElement
    {
        if ($this->_namespace === null) {
            throw new \LogicException('Namespace not set.');
        }

        $xml = $this->_createXML()->addChild($this->_namespace . ':automaticLiquidationType', '', $this->_namespace($this->_namespace));

        $this->_addElements($xml, $this->_data, $this->_namespace);

        return $xml;
    }

    /**
     * {@inheritdoc}
     */

     protected function _configureOptions(OptionsResolver $resolver)
     {
         // available options
         $resolver->setDefined(['type', 'filter', 'agenda']);
     }
}
@segy
Copy link
Member

segy commented Nov 20, 2024

Yes - you'd need to create AutomaticLiquidation class. If you're going to implement, please do not add it under the Type namespace - add a new namespace Liquidation / AutomaticLiquidation.

@Vitexus
Copy link
Author

Vitexus commented Nov 20, 2024

@segy thank you for your advice. Please do not close this issue, I will work on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants