PHPackages                             lark/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. [Database &amp; ORM](/categories/database)
4. /
5. lark/entity

ActiveLibrary[Database &amp; ORM](/categories/database)

lark/entity
===========

Lark Entity

1.0.1(3y ago)1125MITPHP

Since May 19Pushed 3y ago1 watchersCompare

[ Source](https://github.com/shayanderson/lark-entity)[ Packagist](https://packagist.org/packages/lark/entity)[ Docs](https://github.com/shayanderson/lark-entity)[ RSS](/packages/lark-entity/feed)WikiDiscussions 1.x Synced yesterday

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

Lark Entity
===========

[](#lark-entity)

The Entity class is used to simplify creating data classes, creating class properties from an array and creating an array from class properties.

Install using Composer:

```
composer require lark/entity

```

Example:

```
use Lark\Entity;

// class must be subclass of Entity
class Location extends Entity
{
    public string $address;
    public string $city;
}

class User extends Entity
{
    // properties must be public and typed
    // union types are not supported
    public string $name;
    public int $age;
    public bool $isActive = false; // default values
    public Location $location; // deep nested classes supported
}

// populate from array
$user = new User([
    'name' => 'Bob',
    'age' => 25,
    'location' => [
        'address' => '101 main',
        'city' => 'Tampa'
    ]
]);
// or use: $user->fromArray([...])

echo $user->name; // Bob
echo $user->location->address; // 101 main

// get as array
$userArr = $user->toArray(); // [name => Bob, ...]
```

View the `tests/entity.php` file for more examples.

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

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

Total

3

Last Release

1142d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/705163?v=4)[Wang Jian](/maintainers/lark)[@lark](https://github.com/lark)

---

Top Contributors

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

### Embed Badge

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

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

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k117.2M118](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)[pgvector/pgvector

pgvector support for PHP

198741.5k12](/packages/pgvector-pgvector)[jfelder/oracledb

Oracle DB driver for Laravel

11518.4k](/packages/jfelder-oracledb)

PHPackages © 2026

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