2017 © Pedro Peláez
 

library router-entities-resolver

Resolves doctrine entities in the weew/router package.

image

weew/router-entities-resolver

Resolves doctrine entities in the weew/router package.

  • Thursday, July 21, 2016
  • by weew
  • Repository
  • 1 Watchers
  • 0 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Doctrine entities resolver

Build Status Code Quality Test Coverage Version Licence, (*1)

Table of contents

Installation

composer require weew/router-entities-resolver, (*2)

Introduction

This package provides a convenient way to resolve doctrine entities in the weew/router package., (*3)

Usage

Pick an identifier for the entity to be referenced in the router and register a new resolver., (*4)

$router = new Router(new Container());
$resolver = new EntitiesResolver($router);

$resolver
    ->resolve('user', UserRepository::class)
    ->resolve('role', RoleRepository::class);

Now you can resolve entities as with any regular parameter resolver., (*5)

$router->get('api/v1/users/{user}', function(User $user) {
    // entitiy will be injected instead of a user id
});

// or

$route = $router->match(HttpRequestMethod::GET, new Url('api/v1/users/1'));
$user = $route->getParameter('user');

The Versions

21/07 2016

dev-master

9999999-dev

Resolves doctrine entities in the weew/router package.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Maxim Kott

21/07 2016

v1.0.2

1.0.2.0

Resolves doctrine entities in the weew/router package.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Maxim Kott

22/04 2016

v1.0.1

1.0.1.0

Resolves doctrine entities in the weew/php-router package.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Maxim Kott

20/01 2016

v1.0.0

1.0.0.0

Resolves doctrine entities in the weew/php-router package.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Maxim Kott