PHPackages                             didix16/php-apidataobject - 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. didix16/php-apidataobject

ActiveLibrary[API Development](/categories/api)

didix16/php-apidataobject
=========================

A simple library that allows easy handle incoming data from any sources (specially from API sources) and put data in a fashion way which is more practical to access it like an array or object. It allows to implement a DTO very fast.

v1.0.3(4y ago)09.0k1MITPHPPHP &gt;= 7.2

Since Aug 9Pushed 4y ago1 watchersCompare

[ Source](https://github.com/didix16/php-apidataobject)[ Packagist](https://packagist.org/packages/didix16/php-apidataobject)[ RSS](/packages/didix16-php-apidataobject/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (5)Used By (1)

PHP ApiDataObject
=================

[](#php-apidataobject)

A simple library that allows easy handle incoming data from any sources (specially from API sources) and put data in a fashion way which is more practical to access it like an array or object. It allows to implement a DTO very fast.

Content
-------

[](#content)

- [What is an ApiDataObject](#what-is-an-apidataobject)
- [Installation](#installation)
- [Usage](#usage)
- [See also](#see-also)

### What is an ApiDataObject

[](#what-is-an-apidataobject)

It is just a class that can handle incoming data from API sources in JSON format or any other format and structure them in memory to easy handling like an associative array and/or general object.

To pass data into this class, first it should be a simple PHP associative array or plain PHP std object.

It can be created by using JSON string text.

### Installation

[](#installation)

```
composer require didix16/php-apidataobject
```

### Usage

[](#usage)

```
class ApiPlatformDataObject extends ApiDataObject {}

...

class AWebHookProcessor {

    /**
     * @var array|object
     */
    $data;

    public function process()
    {
        $apiData = new ApiPlatformDataObject($this->data);

        /**
         * data =
         * [
         *  'property1' => 'value1',
         *  'property2' => 'value2',
         *  'property3' => 'value3',
         *  'property4' => 'value4',
         * ...
         * ]
         */

        /**
         * Different accessors
         */
        $apiData['property1'];
        $apiData->property1;
        $apiData->property1();

        /**
         * Different setters
         */
        $apiData['property1'] = 'value5';
        $apiData->property1 = 'value5';

        // chainable setter properties
        $apiData
        ->property1('value5')
        ->property2('value6')
        ...
    }

    public function processJson(string $json)
    {
        $apiData = ApiPlatformDataObject::fromJson($json);

        /**
         * Different accessors
         */
        $apiData['property1'];
        $apiData->property1;
        $apiData->property1();

        /**
         * Different setters
         */
        $apiData['property1'] = 'value5';
        $apiData->property1 = 'value5';

        // chainable setter properties
        $apiData
        ->property1('value5')
        ->property2('value6')
        ...

    }
}
```

### See also

[](#see-also)

- [php-apidatamapper](https://github.com/didix16/php-apidatamapper) - A DTO library that allows map incoming API data to any of your entities/models by using a simple filed mapping language.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity49

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 ~15 days

Total

4

Last Release

1698d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

jsonapiarraydataobjectSimpledto

### Embed Badge

![Health badge](/badges/didix16-php-apidataobject/health.svg)

```
[![Health](https://phpackages.com/badges/didix16-php-apidataobject/health.svg)](https://phpackages.com/packages/didix16-php-apidataobject)
```

###  Alternatives

[orisai/object-mapper

Raw data mapping to validated objects

1133.5k2](/packages/orisai-object-mapper)[rekalogika/mapper

An object mapper for PHP and Symfony. Maps an object to another object. Primarily used for transforming an entity to a DTO and vice versa.

3847.7k1](/packages/rekalogika-mapper)[walle89/swedbank-json

Unofficial API client for the Swedbank's and Sparbanken's mobile apps in Sweden.

752.5k](/packages/walle89-swedbank-json)[wayofdev/laravel-symfony-serializer

📦 Laravel wrapper around Symfony Serializer.

2113.6k](/packages/wayofdev-laravel-symfony-serializer)

PHPackages © 2026

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