PHPackages                             moo/hasoneselector - 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. moo/hasoneselector

ActiveSilverstripe-vendormodule[Utility &amp; Helpers](/categories/utility)

moo/hasoneselector
==================

This module provides CMS field to manage data object defined in a has\_one relation.

5.0.0(7mo ago)327.1k—8.3%6MITPHPPHP ^8.3

Since Jul 10Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/satrun77/silverstripe-hasoneselector)[ Packagist](https://packagist.org/packages/moo/hasoneselector)[ Docs](https://github.com/satrun77/silverstripe-hasoneselector)[ RSS](/packages/moo-hasoneselector/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)Dependencies (3)Versions (25)Used By (0)

HasOne Selector
===============

[](#hasone-selector)

[![Build Status](https://camo.githubusercontent.com/f3c63d36a277a37bec2cb7f30dd82c51e64e45070c9c7179cbded91a430913e3/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f73617472756e37372f73696c7665727374726970652d6861736f6e6573656c6563746f722f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/satrun77/silverstripe-hasoneselector/build-status/master)[![Code Coverage](https://camo.githubusercontent.com/ec4c3a99ad24776486ee88a7eda104281f66d4eacf72878423ef57ff72e8a734/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f73617472756e37372f73696c7665727374726970652d6861736f6e6573656c6563746f722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/satrun77/silverstripe-hasoneselector/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/5b01740ff5029b074de1919012e7196e4530aae5b39efce73fbc22bf3459bb2b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f73617472756e37372f73696c7665727374726970652d6861736f6e6573656c6563746f722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/satrun77/silverstripe-hasoneselector/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/3384c710c8c6a14a2b282fac0050068315d2f34e9fa4f680238c367cf6b55ec9/68747470733a2f2f706f7365722e707567782e6f72672f6d6f6f2f6861736f6e6573656c6563746f722f762f737461626c653f666f726d61743d666c6174)](https://packagist.org/packages/moo/hasoneselector)[![License](https://camo.githubusercontent.com/7a5f023739067f1a442535271574af247e2edf90ae4bb657b14b705082439ddf/68747470733a2f2f706f7365722e707567782e6f72672f6d6f6f2f6861736f6e6573656c6563746f722f6c6963656e73653f666f726d61743d666c6174)](https://packagist.org/packages/moo/hasoneselector)

HasOneSelector is a module that provides CMS field to manage data object defined in a has\_one relation.

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

[](#requirements)

- SilverStripe CMS ^6.0

Installation via Composer
-------------------------

[](#installation-via-composer)

```
composer require moo/hasoneselector

```

Usage
-----

[](#usage)

```
use SilverStripe\ORM\DataObject;
use SilverStripe\CMS\Model\SiteTree;
use Moo\HasOneSelector\Form\Field;

class Resource extends DataObject
{
    //...
}

class Page extends SiteTree
{
    //...
    private static $has_one = [
        'Resource' => Resource::class,
    ];

    public function getCMSFields()
    {
        $fields = parent::getCMSFields();

        $resource = Field::create('Resource', 'Resource', $this, Resource::class);
        $fields->addFieldToTab('Root.Main', $resource);

        return $fields;
    }

    //...
}
```

License
-------

[](#license)

This module is under the MIT license. View the [LICENSE](LICENSE.md) file for the full copyright and license information.

###  Health Score

54

—

FairBetter than 96% of packages

Maintenance65

Regular maintenance activity

Popularity32

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity88

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 87.5% 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 ~128 days

Recently: every ~591 days

Total

22

Last Release

212d ago

Major Versions

2.2.0 → 3.x-dev2018-08-20

1.2.2 → 2.2.12018-08-20

2.3.4 → 3.0.02022-07-10

3.0.0 → 4.0.02023-02-13

4.0.0 → 5.0.02025-12-02

PHP version history (5 changes)1.0.0PHP &gt;=5.6

2.0.0PHP &gt;=7.1

3.0.0PHP &gt;=7.4

4.0.0PHP &gt;=8.1

5.0.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/531e6ca1951a4d5d68e4b7c7c3284fe56ffda52d2998b4e4d252bf48ce52ea75?d=identicon)[satrun77](/maintainers/satrun77)

---

Top Contributors

[![satrun77](https://avatars.githubusercontent.com/u/166450?v=4)](https://github.com/satrun77 "satrun77 (42 commits)")[![michalkleiner](https://avatars.githubusercontent.com/u/233342?v=4)](https://github.com/michalkleiner "michalkleiner (3 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")[![normann](https://avatars.githubusercontent.com/u/556224?v=4)](https://github.com/normann "normann (1 commits)")

---

Tags

cms-fieldphpsilverstripesilverstripe-4silverstripe-modulesilverstripecmsformfieldFormsgridfieldhas\_one

###  Code Quality

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/moo-hasoneselector/health.svg)

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

###  Alternatives

[unclecheese/display-logic

Allows assignment of conditions for display and hide of specific form fields based on client side behavior.

771.1M114](/packages/unclecheese-display-logic)[nathancox/codeeditorfield

A field for editing code and JSON in the SilverStripe CMS using Ace Editor (http://ace.c9.io/)

2549.4k5](/packages/nathancox-codeeditorfield)[briceburg/silverstripe-pickerfield

GridField based management of has\_one , has\_many , and many\_many relationship selection

2441.3k1](/packages/briceburg-silverstripe-pickerfield)[sunnysideup/typography

Add a typography test page to your silverstripe website / application.

124.4k4](/packages/sunnysideup-typography)

PHPackages © 2026

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