PHPackages                             rshop/pohoda - 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. [API Development](/categories/api)
4. /
5. rshop/pohoda

Abandoned → [riesenia/pohoda](/?search=riesenia%2Fpohoda)Library[API Development](/categories/api)

rshop/pohoda
============

Pohoda XML communication

v1.26.3(2mo ago)374.8k37[5 PRs](https://github.com/riesenia/pohoda/pulls)MITPHPPHP ^7.1 || ^8.0CI passing

Since Sep 13Pushed 2mo ago6 watchersCompare

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

READMEChangelog (10)Dependencies (5)Versions (76)Used By (0)

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

60

—

FairBetter than 99% of packages

Maintenance85

Actively maintained with recent releases

Popularity35

Limited adoption so far

Community24

Small or concentrated contributor base

Maturity83

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 83.9% 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 ~43 days

Recently: every ~52 days

Total

72

Last Release

77d 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.3PHP ^7.1 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/40c7ed7cfaebeddae57ac4a376c8f21df56dd2f38821b7ba92ea1312ef8020c8?d=identicon)[riesenia](/maintainers/riesenia)

---

Top Contributors

[![segy](https://avatars.githubusercontent.com/u/1355459?v=4)](https://github.com/segy "segy (161 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)")[![andrewvaca](https://avatars.githubusercontent.com/u/7955240?v=4)](https://github.com/andrewvaca "andrewvaca (2 commits)")[![Brezak](https://avatars.githubusercontent.com/u/59848927?v=4)](https://github.com/Brezak "Brezak (2 commits)")[![Mapiiik](https://avatars.githubusercontent.com/u/45870742?v=4)](https://github.com/Mapiiik "Mapiiik (2 commits)")[![lukasvasko](https://avatars.githubusercontent.com/u/255366886?v=4)](https://github.com/lukasvasko "lukasvasko (1 commits)")[![janco-naninails](https://avatars.githubusercontent.com/u/83635317?v=4)](https://github.com/janco-naninails "janco-naninails (1 commits)")[![thomasdv](https://avatars.githubusercontent.com/u/3307649?v=4)](https://github.com/thomasdv "thomasdv (1 commits)")[![haltuf](https://avatars.githubusercontent.com/u/325759?v=4)](https://github.com/haltuf "haltuf (1 commits)")

### Embed Badge

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

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

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[overblog/graphql-bundle

This bundle provides tools to build a GraphQL server in your Symfony App.

8027.9M28](/packages/overblog-graphql-bundle)[m4tthumphrey/php-gitlab-api

GitLab API v4 client for PHP

9485.4M64](/packages/m4tthumphrey-php-gitlab-api)[team-reflex/discord-php

An unofficial API to interact with the voice and text service Discord.

1.1k379.4k24](/packages/team-reflex-discord-php)[apigen/apigen

PHP source code API generator.

2.2k627.9k225](/packages/apigen-apigen)[willdurand/geocoder-bundle

Integration of Geocoder into Symfony

3226.4M12](/packages/willdurand-geocoder-bundle)

PHPackages © 2026

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