PHPackages                             windstep/yandex-realty-feed-generator - 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. windstep/yandex-realty-feed-generator

ActiveLibrary

windstep/yandex-realty-feed-generator
=====================================

v1.1.2(6y ago)31503MITPHPPHP &gt;=7.3

Since Jun 14Pushed 6y agoCompare

[ Source](https://github.com/windstep/yandex-realty-feed-generator)[ Packagist](https://packagist.org/packages/windstep/yandex-realty-feed-generator)[ RSS](/packages/windstep-yandex-realty-feed-generator/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (2)Versions (5)Used By (0)

Yandex Realty Language (YRL) files generator
--------------------------------------------

[](#yandex-realty-language-yrl-files-generator)

YRLGenerator is a simple php library, which provides clean way to create files, which are used to work with yandex realty service. It is based on YRL syntax and is fully valid.

Original documentation
----------------------

[](#original-documentation)

You can find original documentation on [yandex realty feed docs website](https://yandex.ru/support/realty/rules/content-requirements.html)

Installation
------------

[](#installation)

To install, simply type in your terminal following command:

`composer require windstep/yandex-realty-feed-generator`

And make sure, that php version &gt;= 7.3 and ext-xmlwriter is installed and enabled in your system

How to use it
-------------

[](#how-to-use-it)

The main workflow is the following:

```
use Windstep\YRLGenerator\YRLGenerator;
use Windstep\YRLGenerator\Offer;

$outputFilePath = __DIR__ . '/files/created_file.xml';
$temporaryFilePath = __DIR__ . '/files/tmp_file.xml';

$generator = new YRLGenerator($outputFilePath, $temporaryFilePath); // Note, that last one could be null
$generator->beforeWrite();
$offers = [new Offer(1, $data), new Offer(2, $data)]; // Offer keys (first value) must be unique
foreach ($offers as $offer) {
    $generator->bulkWrite($offer);
}
$generator->afterWrite();
```

How data must be added
----------------------

[](#how-data-must-be-added)

To work with data, you must know, that there are three types of data presented.

- Simple data, which is presented like $key =&gt; $value and will be converted to &lt;$key&gt;$value&lt;/$key&gt;
- Array data $key =&gt; $childKey =&gt; $value, which will be converted to &lt;$key&gt;&lt;$childKey&gt;$value&lt;/$childKey&gt;&lt;/$key&gt;
- Special data, like image array, which will be converted by special functions

You can use one of two available chooses to create array of data. Both of variants bellow produces equal result.

**WARNING** if you are using BOTH variants at the same time, values from fluent setters will overwrite data from array.

### Adding data using fluent setters

[](#adding-data-using-fluent-setters)

If you are using most recent version, you might use fluent setters on offer object, so you have to do it like so

```
$offer = new Offer(123456);
        $offer->setType(Type::SELL())
            ->setPropertyType(PropertyType::LIVING())
            ->setCategory(Category::FLAT())
            ->setLocation('Россия', null, null, 'Санкт-Петербург', null, '18-я линия В.О., 32')
            ->setMetro('Василеостровская')
            ->setPrice(4780000, Currency::RUB())
            ->setSalesAgent(null,
                '+7812500400',
                SalesAgentCategory::DEVELOPER(),
                'ЗАО "Застройщик"',
                'http://www.developer.ru/',
                null,
                'http://www.developer.ru/company/logo'
            )
            ->setRooms(2)
            ->setNewFlat()
            ->setBathroomUnit(BathroomUnit::SEPARATED())
            ->setBalcony(BalconyType::BALCONY())
            ->setFloor(13)
            ->setFloorsTotal(15)
            ->setBuildingName('Северная фантазия')
            ->setYandexBuildingId(12345)
            ->setYandexHouseId(54321)
            ->setBuildingSection('Корпус 1')
            ->setBuildingState(BuildingState::UNFINISHED())
            ->setReadyQuarter(3)
            ->setBuiltYear(2018)
            ->setBuildingPhase(3)
            ->setImage('http://www.developer.ru/images/plans/000001289.jpg')
            ->setDescription('Продается 2 к. кв., 13 этаж, 15 минут на машине до метро "Василеостровская". Дом комфорт-класса с продуманными планировочными решениями и широким выбором квартир. Внутренний двор «Северной фантазии» выполнен по эксклюзивному дизайн-проекту. В районе постройки нового ЖК развита инфраструктура: школы и детские сады, больница, аптеки магазины, кафе и спортивные центры. Доступны разные условия ипотеки, скидки и зачет жилья.')
            ->setArea(63.00, Unit::METER_SQUARE())
            ->setLivingSpace(50.00, Unit::METER_SQUARE())
            ->setKitchenSpace(10.00, Unit::METER_SQUARE())
            ->setRoomSpace(15, Unit::METER_SQUARE())
            ->setRoomSpace(35, Unit::METER_SQUARE())
            ->setCreationDate('2015-04-02T19:00:06+03:00');
```

### Adding data using arrays

[](#adding-data-using-arrays)

So, you must create array like following:

```
    $data = [
        'type' => 'продажа',
        'property-type' => 'жилая',
        'category' => 'квартира',
        'creation-date' => '2015-04-02T19:00:06+03:00',
        'location' => [
            'country' => 'Россия',
            'locality-name' => 'Санкт-Петербург',
            'address' => '18-я линия В.О., 32',
            'metro' => [
                'name' => 'Василеостровская'
            ],
        ],
        'price' => [
            'value' => 4780000,
            'currency' => 'RUR',
        ],
        'sales-agent' => [
            'phone' => '+7812500400',
            'organization' => 'ЗАО "Застройщик"',
            'url' => 'http://www.developer.ru/',
            'category' => 'developer',
            'photo' => 'http://www.developer.ru/company/logo',
        ],
        'rooms' => 2,
        'new-flat' => 1,
        'bathroom-unit' => 'раздельный',
        'balcony' => 'балкон',
        'floor' => 13,
        'floors-total' => 15,
        'building-name' => 'Северная фантазия',
        'yandex-building-id' => 12345,
        'yandex-house-id' => 54321,
        'building-section' => 'Корпус 1',
        'building-state' => 'unfinished',
        'ready-quarter' => 3,
        'built-year' => 2018,
        'building-phase' => 3,
        'image' => [
            'http://www.developer.ru/images/plans/000001289.jpg',
        ],
        'description' => 'Продается 2 к. кв., 13 этаж, 15 минут на машине до метро "Василеостровская".
                        Дом комфорт-класса с продуманными планировочными решениями и широким выбором квартир.
                        Внутренний двор «Северной фантазии» выполнен по эксклюзивному дизайн-проекту.
                        В районе постройки нового ЖК развита инфраструктура: школы и детские сады, больница, аптеки,
                        магазины, кафе и спортивные центры. Доступны разные условия ипотеки, скидки и зачет жилья.', // No html tags available here
        'area' => [
            'value' => 63.00,
            'unit' => 'кв. м',
        ],
        'living-space' => [
            'value' => 50.00,
            'unit' => 'кв. м',
        ],
        'kitchen-space' => [
            'value' => 10.00,
            'unit' => 'кв. м',
        ],
        'room-space' => [
            [
                'value' => 15,
                'unit' => 'кв. м',
            ],
            [
                'value' => 35,
                'unit' => 'кв. м',
            ]
        ],

    ]
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~6 days

Total

4

Last Release

2503d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f486db31d03cd59d7665e26aee508d728fa821840c38eb659482cf01dd01b791?d=identicon)[Windstep](/maintainers/Windstep)

---

Top Contributors

[![windstep](https://avatars.githubusercontent.com/u/51027899?v=4)](https://github.com/windstep "windstep (35 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/windstep-yandex-realty-feed-generator/health.svg)

```
[![Health](https://phpackages.com/badges/windstep-yandex-realty-feed-generator/health.svg)](https://phpackages.com/packages/windstep-yandex-realty-feed-generator)
```

###  Alternatives

[paquettg/php-html-parser

An HTML DOM parser. It allows you to manipulate HTML. Find tags on an HTML page with selectors just like jQuery.

2.4k7.9M123](/packages/paquettg-php-html-parser)[netflie/whatsapp-cloud-api

The first PHP SDK to send and receive messages using a cloud-hosted version of the WhatsApp Business Platform

640431.7k4](/packages/netflie-whatsapp-cloud-api)[php-mqtt/client

An MQTT client written in and for PHP.

4372.1M30](/packages/php-mqtt-client)[the-tinderbox/clickhouse-builder

Clickhouse sql query builder

2021.9M23](/packages/the-tinderbox-clickhouse-builder)[json-mapper/json-mapper

Map JSON structures to PHP classes

2181.1M22](/packages/json-mapper-json-mapper)[sylius/refund-plugin

Plugin provides basic refunds functionality for Sylius application.

691.7M14](/packages/sylius-refund-plugin)

PHPackages © 2026

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