PHPackages                             jeurboy/object-field-selector - 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. jeurboy/object-field-selector

ActiveLibrary

jeurboy/object-field-selector
=============================

Class for mapping large and complex object or varible into smaller object

0.1.3(7y ago)0861PHPPHP ^7.0

Since Jun 29Pushed 7y ago1 watchersCompare

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

READMEChangelogDependencies (1)Versions (5)Used By (0)

Field selector for PHP Object
=============================

[](#field-selector-for-php-object)

[![Latest Stable Version](https://camo.githubusercontent.com/3c8f03feca68dbc3289a6abcf50c137c305421f1121760897d2d209cf807dd94/68747470733a2f2f706f7365722e707567782e6f72672f6a657572626f792f6f626a6563742d6669656c642d73656c6563746f722f76657273696f6e)](https://packagist.org/packages/jeurboy/object-field-selector)[![Total Downloads](https://camo.githubusercontent.com/c7c0e7ff7d0eda52097270f6c07b00830c924eaf5a263245f73b6f45edccd0a2/68747470733a2f2f706f7365722e707567782e6f72672f6a657572626f792f6f626a6563742d6669656c642d73656c6563746f722f646f776e6c6f616473)](https://packagist.org/packages/jeurboy/object-field-selector)[![Monthly Downloads](https://camo.githubusercontent.com/f5000acbd800d5486ec4eecfc8be509eb2234d0dfae97a38d0fc1388e796624f/68747470733a2f2f706f7365722e707567782e6f72672f6a657572626f792f6f626a6563742d6669656c642d73656c6563746f722f642f6d6f6e74686c79)](https://packagist.org/packages/jeurboy/object-field-selector)[![Daily Downloads](https://camo.githubusercontent.com/f55b3f5dcdbf66326a482c26d5569c800ad992eddc2f404b416709485e074c17/68747470733a2f2f706f7365722e707567782e6f72672f6a657572626f792f6f626a6563742d6669656c642d73656c6563746f722f642f6461696c79)](https://packagist.org/packages/jeurboy/object-field-selector)

Description
-----------

[](#description)

The library for filter complex array/hash or object and return the actual fields you want to use.

If you have a large variables contained with unused values which not necessary to used. The library will helps by filter out all the unused fields and left your fields on return variable.

The library can traverse the complex array or nested array in any level of array/hash or object.

---

For a deeper knowledge of how to use this package, follow this index:

- [Installation](#installation)
- [Usage](#usage)

Installation
============

[](#installation)

You can install the package via `composer require` command:

```
composer require jeurboy/object-field-selector
```

Or simply add it to your composer.json dependences and run `composer update`:

```
"require": {
    "jeurboy/object-field-selector": "*"
}
```

Usage
=====

[](#usage)

For simple usage. Just create returned schema and send to DataParser;

```
    $parser = new Jeurboy\SimpleObjectConverter\SchemaParser();
    $parser->addSchema("test1");
    $token = $parser->getParsedSchema();

    $data = [
        'test1' => "11234",
        'test2' => "22222"
    ];

    $DataParser = new Jeurboy\SimpleObjectConverter\DataParser();
    $return = $DataParser->getOutput($data, $token);
    print_r($return);
```

You will see following result.

```
Array
(
    [test1] => 11234
)

```

If you have nested Array just pass .(Dot) in your schema.

```
    $parser = new Jeurboy\SimpleObjectConverter\SchemaParser();
    $parser->addSchema("test1.eee");
    $token = $parser->getParsedSchema();

    $data = [
        'test1' => [
            'eee' => "hello holy",
        ]
    ];

    $DataParser = new Jeurboy\SimpleObjectConverter\DataParser();
    $return = $DataParser->getOutput($data, $token);
    print_r($return);
```

You will get result array like this.

```
Array
(
    [test1] => Array
        (
            [eee] => hello holy
        )
)

```

If there are multiple field inside input array, use comma(,) to define more fields.

```
    $parser = new Jeurboy\SimpleObjectConverter\SchemaParser();
    $parser->addSchema("test1");
    $token = $parser->getParsedSchema();

    $data = [
        'test1' => [
            'eee' => "hello holy",
            'fff' => "hello holy",
        ]
    ];

    $DataParser = new Jeurboy\SimpleObjectConverter\DataParser();
    $return = $DataParser->getOutput($data, $token);
    print_r($return);
```

You will see the result has multiple field returned.

```
Array
(
    [test1] => Array
        (
            [eee] => hello holy
            [fff] => hello holy
        )

)

```

The library also support object inside sequencial array.

```
    $parser = new Jeurboy\SimpleObjectConverter\SchemaParser();
    $parser->addSchema("test1.hello");
    $token = $parser->getParsedSchema();

    $data = [
        'test1' => [
            [
                "hello" => "world1",
                "ok"    => "google1",
            ],[
                "hello" => "world2",
                "ok"    => "google2",
            ],
        ]
    ];
    $DataParser = new Jeurboy\SimpleObjectConverter\DataParser();
    $return = $DataParser->getOutput($data, $token);
    print_r($return);
```

Result is

```
Array
(
    [test1] => Array
        (
            [0] => Array
                (
                    [hello] => world1
                )

            [1] => Array
                (
                    [hello] => world2
                )

        )

)

```

You can see all test case in example/example.php files.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

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

Total

3

Last Release

2778d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ccc2ac14ce7218491060332c0df336144722b9c46a36f97ccacfe79bde3b3f80?d=identicon)[jeurboy](/maintainers/jeurboy)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jeurboy-object-field-selector/health.svg)

```
[![Health](https://phpackages.com/badges/jeurboy-object-field-selector/health.svg)](https://phpackages.com/packages/jeurboy-object-field-selector)
```

PHPackages © 2026

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