PHPackages                             saedyousef/dataobject - 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. saedyousef/dataobject

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

saedyousef/dataobject
=====================

PHP Data Object

v1.0.3(3y ago)54273MITPHP

Since Aug 2Pushed 3y ago1 watchersCompare

[ Source](https://github.com/saedyousef/dataobject)[ Packagist](https://packagist.org/packages/saedyousef/dataobject)[ GitHub Sponsors](https://github.com/saedyousef)[ Fund](https://ko-fi.com/saedyousef)[ RSS](/packages/saedyousef-dataobject/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (1)Versions (8)Used By (0)

PHP Data Object

[![Total Downloads](https://camo.githubusercontent.com/9cf7192d1fa45cf10bded7b6f6ced5bc57f7634ba9200bd9039c9f2c9460a919/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73616564796f757365662f646174616f626a656374)](https://packagist.org/packages/saedyousef/dataobject)[![Latest Stable Version](https://camo.githubusercontent.com/ac6e66abfbd95f61cc9d6f6d0077aa33d14f128526e0afb1d299d652e359ff70/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73616564796f757365662f646174616f626a656374)](https://packagist.org/packages/saedyousef/dataobject)[![License](https://camo.githubusercontent.com/9dd3c546bc70cd9793ece00bf860b0e7f266834827520abd9ea317c97eceff47/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f73616564796f757365662f646174616f626a656374)](https://packagist.org/packages/saedyousef/dataobject)[![wakatime](https://camo.githubusercontent.com/d069dbc1f7d3e943a9129ba1c2f1e9547e6c4743de453ca6f43e8b953b8bc390/68747470733a2f2f77616b6174696d652e636f6d2f62616467652f757365722f30336266303765322d346337382d343832362d383630332d3839323266303234313036312f70726f6a6563742f31663733333762372d316362652d343333372d393333302d6333643262323933666437632e737667)](https://wakatime.com/badge/user/03bf07e2-4c78-4826-8603-8922f0241061/project/1f7337b7-1cbe-4337-9330-c3d2b293fd7c)[![Tests](https://github.com/saedyousef/dataobject/actions/workflows/php.yml/badge.svg)](https://github.com/saedyousef/dataobject)

PHP Light DataObject with minimum implementation.

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

[](#installation)

From the command line run:

```
composer require saedyousef/dataobject

```

Usage
-----

[](#usage)

With the package now installed, you can implement the main Interface `DataObject` and by using the trait `DataObjectTrait` that have all the methods implemented for you. Here is an example of a class `PostDataObject` that implements the `DataObject` interface :

```
use SY\DataObject\Contracts\DataObject;
use SY\DataObject\Support\DataObjectTrait;
use SY\DataObject\Support\ObjectReadAccess;
use SY\DataObject\Support\ObjectWriteAccess;

/**
 * @property int|null id
 * @property string title
 * @property string body
 */
class PostDataObject implements DataObject
{
    use DataObjectTrait;
    use ObjectReadAccess;
    use ObjectWriteAccess; // If you need to write object properties.

    public function __construct(array $properties = [])
    {
        $this->_properties = [
            'id'    => null,
            'title' => '',
            'body'  => ''
        ];

        $this->hydrate($properties);
    }

    /**
    * @return int|null
    */
    public function getId()
    {
        return $this->id;
    }

    /**
    * @return string
    */
    public function getTitle(): string
    {
        return $this->title;
    }
}
```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity52

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

7

Last Release

1348d ago

Major Versions

v0.1.3 → v1.0.02022-08-24

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

phpdata-transfer-objectdata object

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/saedyousef-dataobject/health.svg)

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

###  Alternatives

[imanghafoori/laravel-anypass

A minimal yet powerful package to help you in development.

21421.6k](/packages/imanghafoori-laravel-anypass)

PHPackages © 2026

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