PHPackages                             mapik/pohoda-xml - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mapik/pohoda-xml

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mapik/pohoda-xml
================

Pohoda XML communication

v1.25.0(9mo ago)15.8k↑1950%1MITPHPPHP ^7.1 || ^8.0CI failing

Since Sep 13Pushed 9mo agoCompare

[ Source](https://github.com/Mapiiik/pohoda-xml)[ Packagist](https://packagist.org/packages/mapik/pohoda-xml)[ Docs](https://github.com/Mapiiik/pohoda-xml)[ RSS](/packages/mapik-pohoda-xml/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (64)Used By (1)

Pohoda XML
==========

[](#pohoda-xml)

[![Build Status](https://github.com/riesenia/pohoda/workflows/Test/badge.svg)](https://github.com/riesenia/pohoda/actions)[![Latest Version](https://camo.githubusercontent.com/cf0a8bb76a6b3dedb0059b93828e909df063d105e1caf5311313f38767c62b25/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f72696573656e69612f706f686f64612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/riesenia/pohoda)[![Total Downloads](https://camo.githubusercontent.com/822d9261f2b3bf71e9cbb9309011943e22c79fed9e5ec88523a917f767ff014f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f72696573656e69612f706f686f64612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/riesenia/pohoda)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)

Inštalácia
----------

[](#inštalácia)

Pridaním do *composer.json*:

```
{
    "require": {
        "riesenia/pohoda": "~1.0"
    }
}
```

Príkazom:

```
composer require 'riesenia/pohoda:~1.0'
```

Príklad importu objednávok
--------------------------

[](#príklad-importu-objednávok)

Príklady pre import jednotlivých typov viď. *spec* folder.

```
use Riesenia\Pohoda;

$pohoda = new Pohoda('ICO');

// create file
$pohoda->open($filename, 'i_obj1', 'Import orders');

// create order
$order = $pohoda->createOrder([
    'numberOrder' => $order_number,
    'isReserved' => true,
    'date' => $created,
    'text' => '...',
    'partnerIdentity' => [
        'address' => [
            'name' => $billing_name,
            'street' => $billing_street,
            'city' => $billing_city,
            'zip' => $billing_zip,
            'email' => $email,
            'phone' => $phone
        ],
        'shipToAddress' => [
            'name' => $shipping_name,
            'street' => $shipping_street,
            'city' => $shipping_city,
            'zip' => $shipping_zip,
            'email' => $email,
            'phone' => $phone
        ]
    ]
]);

// add items
foreach ($items as $item) {
    $order->addItem([
        'code' => $item->code,
        'text' => $item->text,
        'quantity' => $item->quantity,
        'payVAT' => false,
        'rateVAT' => $item->rate,
        'homeCurrency' => [
            'unitPrice' => $item->unit_price
        ],
        'stockItem' => [
            'stockItem' => [
                'id' => $item->pohoda_id
            ]
        ]
    ]);
}

// add summary
$order->addSummary([
    'roundingDocument' => 'none'
]);

// add order to import (identified by $order_number)
$pohoda->addItem($order_number, $order);

// finish import file
$pohoda->close();
```

Príklad exportu zásob
---------------------

[](#príklad-exportu-zásob)

Vytvorenie príkazu na export sa realizuje prostredníctvom vytvorenia *ListRequest*.

```
use Riesenia\Pohoda;

$pohoda = new Pohoda('ICO');

// create request for export
$pohoda->open($filename, 'e_zas1', 'Export stock');

$request = $pohoda->createListRequest([
    'type' => 'Stock'
]);

// optional filter
$request->addUserFilterName('MyFilter');

$pohoda->addItem('Export 001', $request);

$pohoda->close();
```

Samotné spracovanie dát je riešené jednoducho - volanie `next` vracia *SimpleXMLElement* s danou entitou.

```
// load file
$pohoda->loadStock($filename);

while ($stock = $pohoda->next()) {
    // access header
    $header = $stock->children('stk', true)->stockHeader;

    // ...
}
```

Príklad zmazania zásoby
-----------------------

[](#príklad-zmazania-zásoby)

Pri mazaní je potrebné vytvoriť agendu s prázdnymi dátami a nastaviť jej *delete* actionType.

```
use Riesenia\Pohoda;

$pohoda = new Pohoda('ICO');

// create request for deletion
$pohoda->open($filename, 'd_zas1', 'Delete stock');

$stock = $pohoda->createStock([]);

$stock->addActionType('delete', [
    'code' => $code
]);

$pohoda->addItem($code, $stock);

$pohoda->close();
```

Použitie *ValueTransformer* pre úpravu hodnôt
---------------------------------------------

[](#použitie-valuetransformer-pre-úpravu-hodnôt)

Pomocou rozhrania *ValueTransformer* môžeme implementovať transformátor, ktorý zmení všetky údaje. Príklad pre úpravu všetkých hodnôt na veľké písmena:

```
use Riesenia\Pohoda;

class Capitalizer implements \Riesenia\Pohoda\ValueTransformer\ValueTransformer
{
    public function transform(string $value): string
    {
        return \strtoupper($value);
    }
}

// Register the capitalizer to be used to capitalize values
Pohoda::$transformers[] = new Capitalizer();

$pohoda = new Pohoda('ICO');

...
```

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance58

Moderate activity, may be stable

Popularity24

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 72.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~46 days

Recently: every ~144 days

Total

63

Last Release

271d ago

Major Versions

v0.1.0 → v1.0.02018-05-17

v0.1.1 → v1.8.12021-05-19

PHP version history (3 changes)v0.1.0PHP &gt;=5.4

v1.0.0PHP &gt;=7.1

v1.16.2PHP ^7.1 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/0328bf415a424d611eb990a0cfde9e65fa4566f9225da6f24e7f5e3f7e4a6518?d=identicon)[Mapiiik](/maintainers/Mapiiik)

---

Top Contributors

[![segy](https://avatars.githubusercontent.com/u/1355459?v=4)](https://github.com/segy "segy (153 commits)")[![Mapiiik](https://avatars.githubusercontent.com/u/45870742?v=4)](https://github.com/Mapiiik "Mapiiik (30 commits)")[![stancl](https://avatars.githubusercontent.com/u/33033094?v=4)](https://github.com/stancl "stancl (9 commits)")[![Ciki](https://avatars.githubusercontent.com/u/342730?v=4)](https://github.com/Ciki "Ciki (9 commits)")[![XeLiatH](https://avatars.githubusercontent.com/u/14196085?v=4)](https://github.com/XeLiatH "XeLiatH (3 commits)")[![Brezak](https://avatars.githubusercontent.com/u/59848927?v=4)](https://github.com/Brezak "Brezak (2 commits)")[![andrewvaca](https://avatars.githubusercontent.com/u/7955240?v=4)](https://github.com/andrewvaca "andrewvaca (2 commits)")[![janco-naninails](https://avatars.githubusercontent.com/u/83635317?v=4)](https://github.com/janco-naninails "janco-naninails (1 commits)")[![haltuf](https://avatars.githubusercontent.com/u/325759?v=4)](https://github.com/haltuf "haltuf (1 commits)")[![thomasdv](https://avatars.githubusercontent.com/u/3307649?v=4)](https://github.com/thomasdv "thomasdv (1 commits)")

### Embed Badge

![Health badge](/badges/mapik-pohoda-xml/health.svg)

```
[![Health](https://phpackages.com/badges/mapik-pohoda-xml/health.svg)](https://phpackages.com/packages/mapik-pohoda-xml)
```

###  Alternatives

[friendsofphp/php-cs-fixer

A tool to automatically fix PHP code style

13.5k234.7M20.6k](/packages/friendsofphp-php-cs-fixer)[symfony/rate-limiter

Provides a Token Bucket implementation to rate limit input and output in your application

27047.2M147](/packages/symfony-rate-limiter)[symfony/ldap

Provides a LDAP client for PHP on top of PHP's ldap extension

1407.5M46](/packages/symfony-ldap)[php-soap/ext-soap-engine

An ext-soap engine implementation

443.2M7](/packages/php-soap-ext-soap-engine)[phpbench/container

Simple, configurable, service container.

1512.9M6](/packages/phpbench-container)[symfony/ux-toggle-password

Toggle visibility of password inputs for Symfony Forms

26508.0k5](/packages/symfony-ux-toggle-password)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
