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

feat: added support for nested filters (extId, selectedNumbers, selectedCompanys, selectedIco) #48

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rasstislav
Copy link

$listRequest = $pohoda->createListRequest([
    'type' => 'Order',
]);

$listRequest->addFilter([
    'extId' => [
        'ids' => '2022041186',
        'exSystemName' => 'Riešenia',
    ],
    'selectedNumbers' => [
        'number' => [
            'numberRequested' => '2022041186',
        ],
    ],
    'selectedCompanys' => [
        'company' => ['Riešenia, spol. s r.o.'],
    ],
    'selectedIco' => [
        'ico' => [35948345],
    ],
]);
<lst:listOrderRequest version="2.0" orderVersion="2.0" orderType="receivedOrder">
	<lst:requestOrder>
		<ftr:filter>
			<ftr:extId>
				<typ:ids>2022041186</typ:ids>
				<typ:exSystemName>Riešenia</typ:exSystemName>
			</ftr:extId>
			<ftr:selectedNumbers>
				<ftr:number>
					<typ:numberRequested>2022041186</typ:numberRequested>
				</ftr:number>
			</ftr:selectedNumbers>
			<ftr:selectedCompanys>
				<ftr:company>Riešenia, spol. s r.o.</ftr:company>
			</ftr:selectedCompanys>
			<ftr:selectedIco>
				<ftr:ico>35948345</ftr:ico>
			</ftr:selectedIco>
		</ftr:filter>
	</lst:requestOrder>
</lst:listOrderRequest>

@segy
Copy link
Member

segy commented Nov 20, 2024

hi @rasstislav - sorry to respond so late to this. could you please add that example you provided to tests?

@rasstislav
Copy link
Author

@segy done :-)

@@ -189,7 +189,21 @@ protected function _addRefElement(\SimpleXMLElement $xml, string $name, $value,
}

foreach ($value as $key => $value) {
$node->addChild('typ:' . $key, $this->_sanitize($value), $this->_namespace('typ'));
if (\is_array($value)) {
if (array_is_list($value)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nema backward compatibility

if (\is_array($value)) {
if (array_is_list($value)) {
foreach ($value as $value) {
$node->addChild($namespace . ':' . $key, $this->_sanitize($value), $this->_namespace($namespace));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

toto je dost na mieru toho filtra na to, ze je to umiestnene v Agende. ja by som pravdupovediac idealne tuto cast kodu vobec nechytal

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Successfully merging this pull request may close these issues.

2 participants