PHPackages                             deozza/philarmony-core-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. [Admin Panels](/categories/admin)
4. /
5. deozza/philarmony-core-bundle

ActiveSymfony-bundle[Admin Panels](/categories/admin)

deozza/philarmony-core-bundle
=============================

A bundle to create quickly a modular REST API upon Symfony 4

3.1.1(6y ago)3168[2 issues](https://github.com/deozza/PhilarmonyCore/issues)1MITPHPPHP ^7.1.3

Since May 9Pushed 6y ago1 watchersCompare

[ Source](https://github.com/deozza/PhilarmonyCore)[ Packagist](https://packagist.org/packages/deozza/philarmony-core-bundle)[ RSS](/packages/deozza-philarmony-core-bundle/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (23)Versions (11)Used By (1)

Philarmony
==========

[](#philarmony)

![php](https://camo.githubusercontent.com/e91ffbd23f764553c7ba3dbef9800b30d71268ff4ac35327a2758e50ae6a9e5f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545372e322d626c75652e737667)![mysql](https://camo.githubusercontent.com/cd8e084467dfa8ab879212d4daecee1ab7be67d92ced111021d1fad8ce0e0933/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6d7973716c2d253545352e372d626c75652e737667)[![symfony](https://camo.githubusercontent.com/1193dc75419874f2d03c378734d64ceab9bfb9e77e196f7040f7a9b7f67e81b3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73796d666f6e792d253545342e322d626c75652e737667)](https://symfony.com/doc/current/index.html#gsc.tab=0)[![Build Status](https://camo.githubusercontent.com/679969ed76f54e5b5004987b88816de472081517bcf3c360df1fbeffe6a58a61/68747470733a2f2f7472617669732d63692e6f72672f64656f7a7a612f61747970696b686f7573652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/deozza/atypikhouse)[![Stable](https://camo.githubusercontent.com/25d39d60024cb63e9fbebf3b3082c1824a8a9f6ae4ec9f394dd6f8c8aab59180/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f737461626c652d332e302d627269676874677265656e2e737667)](https://github.com/deozza/Philarmony/tree/3.0.0)![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)

Table of contents
-----------------

[](#table-of-contents)

- [About](#about)
- [Installation](#installation)
- [Configuration](#configuration)
- [Example of usage](#example-of-usage)
- [How it works](#how-it-works)
- [Tests](#tests)
- [Road map](#road-map)

About
-----

[](#about)

Philarmony is a bundle made to help you create a modular REST API. From database to controllers and forms, without forgetting authorization and data validation, manage your API easily in minutes.

V.3.0 - What's new ?
--------------------

[](#v30---whats-new-)

Better performances, this is what can resume Philarmony V3. The core has been rewritten with

Installation
------------

[](#installation)

You can install using composer, assuming it is already installed globally :

`composer require deozza/philarmony-core-bundle`

Configuration
-------------

[](#configuration)

In order yo use Philarmony in your project, you need to configure it. First, create a `philarmony.yaml` file with the following structure :

```
deozza_philarmony:
    directory:
      entity: ~
      property: ~
      enumeration: ~
```

This will be used to locate the database schema files. By default they are created and stored in `/var/Philarmony/`.

Then, to use the embedded services, as the controllers and the repositories, of Philarmony, you need to enable them in your `/config/services.yaml` and in your `config/routes/annotations.yaml` :

```
services:
    Deozza\PhilarmonyCoreBundle\Controller\:
      resource: '@DeozzaPhilarmonyCoreBundle/Controller'
      tags: ['controller.service_arguments']

    Deozza\PhilarmonyCoreBundle\Repository\:
      resource: '@DeozzaPhilarmonyCoreBundle/Repository'
      tags: ['doctrine.service_entity']
```

```
philarmony_controllers:
    resource: '@DeozzaPhilarmonyCoreBundle/Controller'
    type: annotation
    prefix: /
```

Finally, in order to use filters inside your query, add the following functions inside the `doctrine.yaml` configuration file :

```
doctrine:
    orm:
        dql:
            string_functions:
                JSON_EXTRACT: Scienta\DoctrineJsonFunctions\Query\AST\Functions\Mysql\JsonExtract
                JSON_UNQUOTE: Scienta\DoctrineJsonFunctions\Query\AST\Functions\Mysql\JsonUnquote
```

Example of usage
----------------

[](#example-of-usage)

For this example, our API example will manage vacation rentals. Users are able to create rental offers, book vacations and communicate through an internal message service.

Therefore, the database would be constituted with 4 different entity kinds :

- `offer` : contains all the infos about a rental offer
- `booking` : contains all the info about a booking and the offer it is linked with
- `conversation`: contains all the message of a conversation between 2 users
- `message` : contains the content of the message and other informations about it

These entities are defined by default inside the `entity.yaml` configuration file, and their properties inside the `property.yaml` file.

Here is an example of a cUrl request with its body (in JSON) to create a new rental offer :

```
curl --header "Content-Type: application/json"
     --request POST
     --data '{"title": "Stunning appartment in Tokyo", "description": "Located in central Tokyo. 2 bedrooms, bathroom, wifi.", "price": 82, "place_category":"appartment"}'
     http://www.mysuper.app/api/entity/offer

```

As you can see, the kind of entity you post is specified in the url. This will allow Philarmony to adapt the comportment of the API following the logic you implemented in the `yaml` configuration files and via your business logic. Here is the JSON response you would expect from the previous request:

```
{
  "uuid": "00100000-0000-4000-a000-000000000000",
  "kind": "offer",
  "owner": "00100000-0000-4000-a000-000000000000",
  "date_of_Creation": "2019-01-01T12:00:00+02:00",
  "properties": {
    "title": "Stunning appartment in Tokyo",
    "description": "Located in central Tokyo. 2 bedrooms, bathroom, wifi.",
    "price": 82,
    "place_category": "appartment"
  }
}
```

Say that an offer can have multiple descriptions and you want to add another one, simply send a request like the following :

```
curl --header "Content-Type: application/json"
     --request POST
     --data '{"description": "Animals are allowed"}'
     http://www.mysuper.app/api/offer/00100000-0000-4000-a000-000000000000/description

```

Here will be the expected response :

```
{
  "uuid": "00100000-0000-4000-a000-000000000000",
  "kind": "offer",
  "owner": "00100000-0000-4000-a000-000000000000",
  "date_of_Creation": "2019-01-01T12:00:00+02:00",
  "properties": {
    "title": "Stunning appartment in Tokyo",
    "description": [
       "Located in central Tokyo. 2 bedrooms, bathroom, wifi.",
       "Animals are allowed"
       ],
    "price": 82,
    "house_category": "appartment"
    }
}
```

Responses
---------

[](#responses)

Response codeRaised byDetails200The request is successfulMore201The post request is successfulMore204The request is successful and the response has an empty bodyMore400Form error assertionMore403User is not allowed to perform this requestMore404The resource requested was not foundMore405The method used is not allowed on the route requestedMore409The request is successful but the data submitted is not validMoreWhen you perform a request to Philarmony, it will always send a response containing a serialized JSON and one of the HTTP code listed above.

How it works
------------

[](#how-it-works)

### Database schema

[](#database-schema)

Your database schema is fully designed by 3 yaml files.

#### Entity

[](#entity)

An Entity is what could be view as a MySQL table, a main container of data. By default, it is defined by an owner (the User who created the entity), a kind, the date it was create and its properties.

- [Read more](src/Resources/documentation/DatabaseSchema/ENTITY.md)

#### Property

[](#property)

The property is what could be view as a MySQL column, the container of a specific data. By default, it is defined by a type, a `unique` paremeter and a `required` parameter.

- [Read more](src/Resources/documentation/DatabaseSchema/PROPERTY.md)

#### Enumeration

[](#enumeration)

The enumeration is a list of possible values handled by of property.

- [Read more](src/Resources/documentation/DatabaseSchema/ENUMERATION.md)

### Validation state

[](#validation-state)

Validation state is used in order to assert an entity is in good conditions to be used. Each state defines specific methods usable by specific users.

- [Read more](src/Resources/documentation/Validation/VALIDATIONSTATE.md)

#### Authorization

[](#authorization)

To assure the right user is manipulating a resource, authorization is handled by the validation state. It determines which users are allowed to send the different requests.

- [Read more](src/Resources/documentation/Validation/AUTHORIZATION.md)

#### Constraints

[](#constraints)

In order to pass from one state to the next, the entity and its data must be valid according to constraints.

- [Read more](src/Resources/documentation/Validation/CONSTRAINTS.md)

#### Conflict rules

[](#conflict-rules)

A conflict rules is a custom and advanced constraint that need to be developed and cannot be added to a configuration file.

- [Read more](src/Resources/documentation/RuleManager/CONFLICTRULE.md)

Tests
-----

[](#tests)

A demo app has been developped and is visible [here](https://github.com/deozza/atypikhouse). Through the tests of this app, we ensure that every feature of Philarmony is tested and we garanty the stability of the bundle.

Road map
--------

[](#road-map)

- Database migration : for now, when you delete or update a property or an entity, you need to handle manually the migration. For a better experience, I am thinking about a kind of automatic solution

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance7

Infrequent updates — may be unmaintained

Popularity14

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

Recently: every ~24 days

Total

7

Last Release

2447d ago

Major Versions

1.2.5 → 2.0.12019-06-19

2.0.1 → 3.0.82019-07-25

### Community

Maintainers

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

---

Top Contributors

[![deozza](https://avatars.githubusercontent.com/u/17722388?v=4)](https://github.com/deozza "deozza (224 commits)")

---

Tags

api-restbundlecrudcrud-generatormodularsymfony-bundlesymfony4

### Embed Badge

![Health badge](/badges/deozza-philarmony-core-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/deozza-philarmony-core-bundle/health.svg)](https://phpackages.com/packages/deozza-philarmony-core-bundle)
```

###  Alternatives

[kimai/kimai

Kimai - Time Tracking

4.6k7.4k1](/packages/kimai-kimai)[pumukit/pumukit

Media Portal

5714.0k36](/packages/pumukit-pumukit)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[easycorp/easyadmin-demo

EasyAdmin Demo Application

145.7k](/packages/easycorp-easyadmin-demo)[contao/core-bundle

Contao Open Source CMS

1231.6M2.3k](/packages/contao-core-bundle)

PHPackages © 2026

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