PHPackages                             jinnguyen/puja-entity - 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. jinnguyen/puja-entity

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

jinnguyen/puja-entity
=====================

Puja-Entity is an abstract layer to manage a entity object and easy to get the Docblock document

v1.3.1(9y ago)01053Apache License 2.0PHPPHP &gt;=5.3

Since Nov 18Pushed 9y ago1 watchersCompare

[ Source](https://github.com/jinnguyen/puja-entity)[ Packagist](https://packagist.org/packages/jinnguyen/puja-entity)[ RSS](/packages/jinnguyen-puja-entity/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (2)DependenciesVersions (3)Used By (3)

puja-entity
===========

[](#puja-entity)

Puja-Entity is an abstract layer to manage a entity object and easy to get the Docblock document

**Install**

```
composer required jinnguyen/puja-entity
```

**Usage**

```
include '/path/to/vendor/autoload.php';
use Puja\Entity\Entity;
```

**Examples**

```
/**
 * This comment is copied from ContentEntity->getDocblock(); you should do it each time you change the ContentEntity->attributes
 * @method int getId()
 * @method setId(int $attr)
 * @method hasId()
 * @method unsetId()
 * @method string getName()
 * @method setName(string $attr)
 * @method hasName()
 * @method unsetName()
 * @method string getCreatedAt()
 * @method setCreatedAt(string $attr)
 * @method hasCreatedAt()
 * @method unsetCreatedAt()
 * @method string getCreatedAt()
 * @method setCreatedAt(string $attr)
 * @method hasCreatedAt()
 * @method unsetCreatedAt()
 * @method Category getCategory()
 * @method setCategory(Category $attr)
 * @method hasCategory()
 * @method unsetCategory()
 */
class ContentEntity extends Entity
{
    protected $attributes = array(
        'id' => Entity::DATATYPE_INT,
        'name' => Entity::DATATYPE_STRING,
        'created_at' => Entity::DATATYPE_STRING,
        'price' => Entity::DATATYPE_INT,
        'category' => 'Category',
    );
    protected $defaults = array(
        'price' => 5,
    );
}

class Category
{
    public $id = 1;
    public $name = 'Category 1';
}

$content = new ContentEntity(array(
    'id' => 1,
    'name' => 'Content 1',
    'created_at' => '2016-11-18 00:00:00',
    'category' => new Category()
));

echo $content->getId(); // 1
echo $content->getName(); // Content 1
echo $content->getCreatedAt(); // 2016-11-18 00:00:00
echo $content->getId(); // 5

$category = $content->getCategory();
echo $category->name; // Category 1
echo $content->getDocblock(); // The dockbock content is used above class ContentEntity
```

**Note**: ContentEntity is Entity, but Category is not.

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% 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 ~30 days

Total

2

Last Release

3481d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/25e5bd31b5dd70d47cbdc738bded06dbabfba3d584acce63c2c4b4fb7847f39d?d=identicon)[jinnguyen](/maintainers/jinnguyen)

---

Top Contributors

[![linhnmt](https://avatars.githubusercontent.com/u/10231628?v=4)](https://github.com/linhnmt "linhnmt (2 commits)")[![linhnnmt](https://avatars.githubusercontent.com/u/162856460?v=4)](https://github.com/linhnnmt "linhnnmt (1 commits)")

---

Tags

entitypuja

### Embed Badge

![Health badge](/badges/jinnguyen-puja-entity/health.svg)

```
[![Health](https://phpackages.com/badges/jinnguyen-puja-entity/health.svg)](https://phpackages.com/packages/jinnguyen-puja-entity)
```

###  Alternatives

[shapecode/hidden-entity-type-bundle

Hidden field for Symfony entities

28441.3k1](/packages/shapecode-hidden-entity-type-bundle)[smile/module-custom-entity

Smile - Custom Entity Module

37108.4k6](/packages/smile-module-custom-entity)[smile/module-custom-entity-product-link

Smile - Custom Entity Product link Module

3269.9k1](/packages/smile-module-custom-entity-product-link)

PHPackages © 2026

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