PHPackages                             moderntribe/square1-field-models - 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. moderntribe/square1-field-models

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

moderntribe/square1-field-models
================================

Data Transfer Objects (models) and Collections for ACF

4.2.3(3y ago)12.4kGPL-2.0-onlyPHPPHP &gt;=7.4

Since May 9Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/moderntribe/square1-field-models)[ Packagist](https://packagist.org/packages/moderntribe/square1-field-models)[ RSS](/packages/moderntribe-square1-field-models/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (1)Versions (22)Used By (0)

SquareOne Field Models
======================

[](#squareone-field-models)

Utilizes [Spatie Data Transfer Objects v2](https://github.com/spatie/data-transfer-object/tree/v2) to provide models for ACF fields that support arrays, avoiding needing to remember these field structures and providing autocompletion for your IDE.

Usage
-----

[](#usage)

Simply create a class that extends [Field\_Model](Field_Model.php), set your properties and types to match what ACF returns when it fetches the array of field data, pass that array to your model and it will get automatically populated, allowing you to use the class properties to access the data.

Examples
--------

[](#examples)

Imagine you have an [ACF User Field](https://www.advancedcustomfields.com/resources/user/). Simply pass the ACF field data to the existing [User Model](Models/User.php), for example:

```
$user = new \Tribe\Libs\Field_Models\Models\User( (array) get_field( 'user_field' ) );

echo $user->ID; // e.g. 22
echo $user->user_firstname; // e.g. Steve
// etc...
```

You can also make Collections, which will take [ACF Repeater](https://www.advancedcustomfields.com/resources/repeater/) data. Expanding on the User example above, imagine you have a repeater of User fields, simply pass the repeater data directly to the collection's create method:

```
$user_collection = \Tribe\Libs\Field_Models\Collections\User_Collection::create( (array) get_field( 'user_repeater' ) );

foreach ( $user_collection as $user ) {
    echo $user->ID;
}
```

Requirements
------------

[](#requirements)

- PHP 7.4+
- Advanced Custom Fields Or, the PRO version for repeaters

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance49

Moderate activity, may be stable

Popularity17

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 60% 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 ~9 days

Recently: every ~16 days

Total

20

Last Release

1295d ago

Major Versions

1.2.0 → 4.0.162022-08-17

PHP version history (2 changes)1.0.0PHP ^7.4

4.0.16PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/1a11f5bee6606989680c8f81b921f8a8e2e75bfd5190cb001812ed615d032a5e?d=identicon)[tribejustin](/maintainers/tribejustin)

![](https://www.gravatar.com/avatar/7f24821ddc28f26fff6b85940d5c65cf179e7487695383944b80f2e5257db6a0?d=identicon)[nickpelton](/maintainers/nickpelton)

---

Top Contributors

[![defunctl](https://avatars.githubusercontent.com/u/1066195?v=4)](https://github.com/defunctl "defunctl (3 commits)")[![tr1b0t](https://avatars.githubusercontent.com/u/14128420?v=4)](https://github.com/tr1b0t "tr1b0t (2 commits)")

### Embed Badge

![Health badge](/badges/moderntribe-square1-field-models/health.svg)

```
[![Health](https://phpackages.com/badges/moderntribe-square1-field-models/health.svg)](https://phpackages.com/packages/moderntribe-square1-field-models)
```

###  Alternatives

[moderntribe/tribe-libs

A library for use on Modern Tribe service projects.

1348.8k2](/packages/moderntribe-tribe-libs)

PHPackages © 2026

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