PHPackages                             jeyroik/extas-fields-conditions - 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. jeyroik/extas-fields-conditions

ActiveLibrary

jeyroik/extas-fields-conditions
===============================

Fields conditions for Extas

1.1.0(5y ago)04391PHP

Since May 20Pushed 5y ago1 watchersCompare

[ Source](https://github.com/jeyroik/extas-fields-conditions)[ Packagist](https://packagist.org/packages/jeyroik/extas-fields-conditions)[ RSS](/packages/jeyroik-extas-fields-conditions/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (11)Versions (5)Used By (1)

[![PHP Composer](https://github.com/jeyroik/extas-fields-conditions/workflows/PHP%20Composer/badge.svg?branch=master&event=push)](https://github.com/jeyroik/extas-fields-conditions/workflows/PHP%20Composer/badge.svg?branch=master&event=push)[![codecov.io](https://camo.githubusercontent.com/21b23484cb780b026d93c80859499629911af61b0b742e7a18bf17537f09cd97/68747470733a2f2f636f6465636f762e696f2f67682f6a6579726f696b2f65787461732d6669656c64732d636f6e646974696f6e732f636f7665726167652e7376673f6272616e63683d6d6173746572)](https://camo.githubusercontent.com/21b23484cb780b026d93c80859499629911af61b0b742e7a18bf17537f09cd97/68747470733a2f2f636f6465636f762e696f2f67682f6a6579726f696b2f65787461732d6669656c64732d636f6e646974696f6e732f636f7665726167652e7376673f6272616e63683d6d6173746572)[![PHPStan Enabled](https://camo.githubusercontent.com/441b5874ce4df0a2defc892979c96c46889b69cb32119d04f0b48626349f8bc9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d656e61626c65642d627269676874677265656e2e7376673f7374796c653d666c6174)](https://github.com/phpstan/phpstan)[![](https://camo.githubusercontent.com/ff0aa5e0dc87c472d7e63e38b7e7911e29cd2551422645d44398088bd0571b7a/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f62303662323037363061626333613634306231362f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/jeyroik/extas-fields-conditions/maintainability)

Описание
========

[](#описание)

Пакет позволяет настроить для полей условия (проверки) для стадий

- перед созданием
- после создания
- перед обновлением
- после обновления
- перед удаленеим
- после удаления

Использование
=============

[](#использование)

Для нашей сущности `item` настроим две проверки перед созданием:

- Проверим, что значение не равно `test`.
- Проверим, что сущность с текущим значением отсутствует.

`extas.json`

```
{
  "fields": [
    {
      "name": "value",
      "parameters": {
        "subject": {
          "name": "subject",
          "value": "item"
        }
      },
      "before_create": [
        {
          "condition": "neq",
          "value": "test"
        },
        {
          "condition": "empty",
          "value": {
            "repository": "itemRepository",
            "method": "all",
            "query": {"value": "@value"}
          }
        }
      ]
    }
  ]
}
```

```
/**
 * @method itemRepo()
 */
$item = new class ([
    'value' => 'test'
]) extends \extas\components\Item {
    use \extas\components\THasValue;
    protected function getSubjectForExtension() : string{
        return 'item';
    }
};

try {
    $this->itemRepo()->create($item); // Exception "Condition failed"
} catch (\Exception $e) {

}
$item->setValue('unique');
$this->itemRepo()->create($item); // ok
$this->itemRepo()->create($item); // Exception "Condition failed"
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

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

Total

3

Last Release

2075d ago

Major Versions

0.1.0 → 1.0.02020-05-22

### Community

Maintainers

![](https://www.gravatar.com/avatar/2aaec5c4bade6ab2b5d1a0f7d97ab4e0ff2ce83937f76499b2888ad16cde5e04?d=identicon)[jeyroik](/maintainers/jeyroik)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jeyroik-extas-fields-conditions/health.svg)

```
[![Health](https://phpackages.com/badges/jeyroik-extas-fields-conditions/health.svg)](https://phpackages.com/packages/jeyroik-extas-fields-conditions)
```

PHPackages © 2026

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