PHPackages                             gl3n/serialization-group-bundle - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. gl3n/serialization-group-bundle

ActiveSymfony-bundle[Parsing &amp; Serialization](/categories/parsing)

gl3n/serialization-group-bundle
===============================

Provides a way to organize serialization groups through configuration

1.0.1(10y ago)58.3k2PHPPHP &gt;=5.4

Since Mar 27Pushed 7y ago2 watchersCompare

[ Source](https://github.com/gl3n/SerializationGroupBundle)[ Packagist](https://packagist.org/packages/gl3n/serialization-group-bundle)[ RSS](/packages/gl3n-serialization-group-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (3)Versions (5)Used By (0)

SerializationGroupBundle [![Build Status](https://camo.githubusercontent.com/17b6297daf0b14a99b8aaad4dab3c0326114fa40c3d8dee4f250d849f25a6450/68747470733a2f2f7472617669732d63692e6f72672f676c336e2f53657269616c697a6174696f6e47726f757042756e646c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/gl3n/SerializationGroupBundle)
===============================================================================================================================================================================================================================================================================================================================================

[](#serializationgroupbundle-)

SerializationGroupBundle provides a way to **organize serialization groups** through configuration.

It is useful to use with Symfony Serializer component or JMS Serializer.

1. Installation
---------------

[](#1-installation)

Install the bundle through composer, then add it to your `AppKernel.php` file :

```
$bundles = array(
    // ...
    new Gl3n\SerializationGroupBundle\Gl3nSerializationGroupBundle(),
);
```

2. Configuration
----------------

[](#2-configuration)

Here is a sample configuration :

```
gl3n_serialization_group:
    groups:
        group2:
            roles: [ROLE_USER]
        group3:
            roles: [ROLE_ADMIN]
            include: [group2]
        group4:
            roles: [ROLE_SUPER_ADMIN]
            include: [group1, group3]
```

You can fill on each group :

- `roles` *(optional)* : an array of security roles allowed to use this group
- `include` *(optional)* : an array of included groups

3. Usage
--------

[](#3-usage)

Call the **serialization group resolver** (`gl3n_serialization_group.resolver`) in order to get the built groups list.

For example, with the previous sample configuration :

```
// Resolving group1 returns ['group1']
$groups = $resolver->resolve('group1');

// Resolving group3 returns ['group2', 'group3']
$groups = $resolver->resolve('group3');

// Resolving group4 returns ['group1', 'group2', 'group3', 'group4']
$groups = $resolver->resolve('group4');
```

### 3.1. Authorization checker

[](#31-authorization-checker)

Security roles are checked during resolution. If user has not the required role a `Symfony\Component\Security\Core\Exception\AccessDeniedException` is thrown.

### 3.2. Example

[](#32-example)

You can organise entity serialization groups by **size** (small, medium, large) and serialize several entities at once like that :

```
# config.yml
gl3n_serialization_group:
    groups:
        book_M:
            roles: [ROLE_USER]
            include: [book_S, author_S]
        book_L:
            roles: [ROLE_ADMIN]
            include: [book_M, author_M]
        author_M:
            include: [author_S]
```

In this example, a **book** has one or many **authors**.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity61

Established project with proven stability

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

Total

3

Last Release

3724d ago

Major Versions

1.0.1 → 2.x-dev2016-03-08

### Community

Maintainers

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

---

Top Contributors

[![gl3n](https://avatars.githubusercontent.com/u/965689?v=4)](https://github.com/gl3n "gl3n (9 commits)")

---

Tags

serializationdeserializationgroup

### Embed Badge

![Health badge](/badges/gl3n-serialization-group-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/gl3n-serialization-group-bundle/health.svg)](https://phpackages.com/packages/gl3n-serialization-group-bundle)
```

###  Alternatives

[jms/serializer-bundle

Allows you to easily serialize, and deserialize data of any complexity

1.8k89.3M627](/packages/jms-serializer-bundle)[jms/serializer

Library for (de-)serializing data of any complexity; supports XML, and JSON.

2.3k135.8M851](/packages/jms-serializer)[flix-tech/avro-serde-php

A library to serialize and deserialize Avro records making use of the confluent schema registry

674.0M17](/packages/flix-tech-avro-serde-php)

PHPackages © 2026

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