Skip to content

Conversation

@lukasluecke
Copy link
Contributor

@lukasluecke lukasluecke commented Jul 13, 2020

This is a pre-requisite for #3476 (MR #3551) and #3352 (see #3543 (comment) for details).

Also deduplicated a bit of the shared logic between CrudController and DashboardController creation.

return $this->getController(DashboardControllerInterface::class, $dashboardControllerFqcn, 'index', $request);
}

private function getCrudController(?string $crudControllerFqcn, ?string $crudAction, Request $request): ?CrudControllerInterface
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've noticed that from AdminContext you can only get the $crudControllerFqcn, not the $crudId - so maybe this one should be public so you don't need to always also inject the CrudControllerRegistry. Or make the $crudId available in AdminContext.

@javiereguiluz
Copy link
Collaborator

Thanks Lukas. While merging I changed the name of getDashboardControllerInstanceFromContextId() to getDashboardControllerInstance() to be consistent with the name of the other methods.

javiereguiluz added a commit to javiereguiluz/EasyAdminBundle that referenced this pull request Jul 15, 2020
This PR was merged into the 3.0.x-dev branch.

Discussion
----------

Extract ControllerFactory service

This is a pre-requisite for EasyCorp#3476 (MR EasyCorp#3551) and EasyCorp#3352 (see EasyCorp#3543 (comment) for details).

Also deduplicated a bit of the shared logic between CrudController and DashboardController creation.

Commits
-------

ed63197 Extract ControllerFactory service
javiereguiluz added a commit that referenced this pull request Nov 11, 2020
…tocomplete) (lukasluecke)

This PR was squashed before being merged into the 3.0.x-dev branch.

Discussion
----------

Add option to modify query of AssociationField (with autocomplete)

Resolves #3476. Depends on #3550.

Works the same for "default" and autocomplete fields.

```php
AssociationField::new('property')
    ->autocomplete() // optional
    ->modifyQuery(fn(QueryBuilder $queryBuilder) => $queryBuilder
        ->where('entity.id > 20')
        ->orderBy('entity.field', 'DESC')
    );
```

Commits
-------

4716e81 Add option to modify query of AssociationField (with autocomplete)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants