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

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

pollen/entity
=============

A modern PHP package for WordPress custom post types and taxonomies

1.2.0(1mo ago)2127[1 issues](https://github.com/Pollora/WordPressEntity/issues)GPL-2.0-or-laterPHPPHP ^8.2CI failing

Since Oct 21Pushed 7mo ago2 watchersCompare

[ Source](https://github.com/Pollora/WordPressEntity)[ Packagist](https://packagist.org/packages/pollen/entity)[ RSS](/packages/pollen-entity/feed)WikiDiscussions main Synced yesterday

READMEChangelogDependencies (12)Versions (7)Used By (0)

Pollora Entity WordPress Package
================================

[](#pollora-entity-wordpress-package)

A modern PHP 8.2+ library for easily managing WordPress custom post types and taxonomies with a fluent interface and hexagonal architecture.

Features
--------

[](#features)

- 🚀 Modern PHP 8.2+ with type declarations
- 🏗️ Fluent interface for easy configuration
- 🔧 Built on top of [Extended CPTs](https://github.com/johnbillion/extended-cpts) library
- 📐 Hexagonal architecture for better separation of concerns
- 🧪 Fully tested with PestPHP
- 💡 Intuitive method naming with dedicated methods for boolean properties

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

[](#installation)

```
composer require pollora/entity
```

Documentation
-------------

[](#documentation)

- [Post Types Documentation](docs/post-types.md) - Complete guide for creating and configuring custom post types
- [Taxonomies Documentation](docs/taxonomies.md) - Complete guide for creating and configuring custom taxonomies

Quick Start
-----------

[](#quick-start)

### Post Types

[](#post-types)

```
use Pollora\Entity\PostType;

PostType::make('book', 'Book', 'Books')
    ->public()
    ->showInRest()
    ->hasArchive()
    ->supports(['title', 'editor', 'thumbnail'])
    ->menuIcon('dashicons-book-alt');
```

### Taxonomies

[](#taxonomies)

```
use Pollora\Entity\Taxonomy;

Taxonomy::make('genre', 'book', 'Genre', 'Genres')
    ->hierarchical()
    ->showInRest()
    ->showInQuickEdit();
```

Architecture
------------

[](#architecture)

This package follows hexagonal architecture principles:

1. **Domain Layer**: Core business logic (Entity, PostType, Taxonomy)
2. **Application Layer**: Services that orchestrate operations
3. **Adapter Layer**: WordPress integration adapters

The Domain layer remains independent of external dependencies, defining interfaces (ports) that adapters implement.

Testing
-------

[](#testing)

The package includes comprehensive unit tests using PestPHP with WordPress function mocks:

```
composer test
```

### Test Structure

[](#test-structure)

- `tests/helpers.php`: Global WordPress function mocks
- `tests/ext_cpts_helpers.php`: Extended CPTs namespace function mocks
- `tests/bootstrap.php`: Test environment setup

License
-------

[](#license)

This package is open-source software licensed under the MIT license.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance64

Regular maintenance activity

Popularity13

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.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 ~284 days

Total

3

Last Release

53d ago

PHP version history (2 changes)1.0PHP ^8.1

1.2.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/8435080f3e74b629258f291a62cb72aa9d63ee44d74e588f594dc6378c328fa2?d=identicon)[amphibee](/maintainers/amphibee)

---

Top Contributors

[![ogorzalka](https://avatars.githubusercontent.com/u/149651?v=4)](https://github.com/ogorzalka "ogorzalka (18 commits)")[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (1 commits)")

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/pollen-entity/health.svg)](https://phpackages.com/packages/pollen-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)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45444.2k1](/packages/pressbooks-pressbooks)[jfelder/oracledb

Oracle DB driver for Laravel

11518.4k](/packages/jfelder-oracledb)[pollora/query

Create WP Query in a fluent way.

184.1k2](/packages/pollora-query)

PHPackages © 2026

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