Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/alexander-schranz/sulu-backend-bundle

A Sulu Bundle to make it easier to create new Backend Bundles.
https://github.com/alexander-schranz/sulu-backend-bundle

Last synced: 2 months ago
JSON representation

A Sulu Bundle to make it easier to create new Backend Bundles.

Awesome Lists containing this project

README

        

# SULU Backend Bundle

Inspired by doctrine crud generator.

A Sulu Bundle to make it easier to create a new Backend Bundle.

With this Bundle it should be possible to create a Backend Bundles without
the knowledge of husky the sulu javascript framework.

# Installation

```bash
composer require l91/sulu-backend-bundle
```

**Add Bundle to AdminKernel**

```php
$bundles[] = new L91\Sulu\Bundle\BackendBundle\L91SuluBackendBundle();
```

# Usage

As example we will create a API for an entity called Vehicle.

## 1. Create Entity

First create the doctrine entity with a `.orm.xml`.

## 2. Create Repository

Create a Repository for loading entities from the database.
The `BackendRepository` have a default implementation for them:

- `findById`
- `findAll`
- `count`

Create the functions in your repository or extend from the BackendRepository.

```php