Skip to content

Commit 8d718af

Browse files
committed
Merge branch '2.1'
2 parents ea2fcdb + f999424 commit 8d718af

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

core/events.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ final class BookMailSubscriber implements EventSubscriberInterface
6464
}
6565
```
6666

67-
If you use the official API Platform distribution, creating the previous class is enough. [DunglasActionBundle](https://github.com/dunglas/DunglasActionBundle)
68-
(installed by default) will automatically register this subscriber as a service and will inject its dependencies using [the
69-
autowiring feature of the Symfony Dependency Injection Container](http://symfony.com/doc/current/components/dependency_injection/autowiring.html).
67+
If you use the official API Platform distribution, creating the previous class is enough. The Symfony Dependency Injection
68+
component will automatically register this subscriber as a service and will inject its dependencies thanks to the [autowiring
69+
feature](http://symfony.com/doc/current/components/dependency_injection/autowiring.html).
7070

71-
If you don't have DunglasActionBundle installed, [the subscriber must be registered manually](http://symfony.com/doc/current/components/http_kernel/introduction.html#creating-an-event-listener).
71+
Alternatively, [the subscriber must be registered manually](http://symfony.com/doc/current/components/http_kernel/introduction.html#creating-an-event-listener).
7272

7373
[Doctrine events](http://doctrine-orm.readthedocs.org/en/latest/reference/events.html#reference-events-lifecycle-events)
7474
are also available (if you use it) if you want to hook at the object lifecycle events.

core/operations.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ API Platform Core relies on the concept of operations. Operations can be applied
44
an implementation point of view, an operation is a link between a resource, a route and its related controller.
55

66
API Platform automatically registers typical [CRUD](https://en.wikipedia.org/wiki/Create,_read,_update_and_delete) operations
7-
and describes them in the exposed documentation (Hydra and NelmioApiDoc). It also creates and registers routes corresponding
7+
and describes them in the exposed documentation (Hydra and Swagger). It also creates and registers routes corresponding
88
to these operations in the Symfony routing system (if it is available).
99

1010
The behavior of built-in operations is briefly presented in the [Getting started](getting-started.md#mapping-the-entities)
@@ -353,15 +353,12 @@ implements the [Action-Domain-Responder](https://github.com/pmjones/adr) pattern
353353

354354
Note: [the event system](events.md) should be preferred over custom controllers when applicable.
355355

356-
The distribution of API Platform also comes with an enhanced action system for Symfony pre-installed: [DunglasActionBundle](https://github.com/dunglas/DunglasActionBundle).
357-
*DunglasActionBundle* eases the implementation of the ADR pattern with Symfony and improves the developer experience.
358-
359-
It automatically registers action classes stored in `src/*Bundle/Action` and `src/*Bundle/Controller` directories as autowired
360-
services.
356+
The distribution of API Platform also eases the implementation of the ADR pattern: it automatically registers action classes
357+
stored in `src/AppBundle/Action` and `src/AppBundle/Controller` as autowired services.
361358

362359
Thanks to the [autowiring](http://symfony.com/doc/current/components/dependency_injection/autowiring.html) feature of the
363-
Symfony dependency injection container, services required by an action can be type-hinted in its controller, it will be automatically
364-
instantiated and injected, without having to declare it explicitly.
360+
Symfony Dependency Injection container, services required by an action can be type-hinted in its constructor, it will be
361+
automatically instantiated and injected, without having to declare it explicitly.
365362

366363
In the following example, the built-in `GET` operation is registered as well as a custom operation called `special`.
367364
The `special` operation reference the Symfony route named `book_special`.
@@ -473,8 +470,8 @@ It is mandatory to set the `_api_resource_class` and `_api_item_operation_name`
473470
operation) in the parameters of the route (`defaults` key). It allows API Platform and the Symfony routing system to hook
474471
together.
475472

476-
Here we consider that DunglasActionBundle is installed (the default when using the API Platform distribution). This
477-
action will be automatically registered as a service (the service name is the same as the class name: `AppBundle\Action\BookSpecial`).
473+
Here we consider that the autowiring enabled for controller classes (the default when using the API Platform distribution).
474+
This action will be automatically registered as a service (the service name is the same as the class name: `AppBundle\Action\BookSpecial`).
478475

479476
API Platform automatically retrieves the appropriate PHP entity then deserializes it, and for `POST` and `PUT` requests
480477
updates the entity with data provided by the user.

0 commit comments

Comments
 (0)