-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[findEntityFqcnByCrud] - Allows you to find the Fqcn of an entity fro…
…m the crud, either based on the 'findEntityFqcnByCrud' or on the 'findEntityFqcnByCrud' method.
- Loading branch information
Qamar HAYAT
committed
Nov 20, 2023
1 parent
7003ee7
commit 1daaae6
Showing
2 changed files
with
5 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,8 @@ | |
|
||
namespace EasyCorp\Bundle\EasyAdminBundle\Registry; | ||
|
||
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Controller\CrudControllerInterface; | ||
|
||
/** | ||
* @author Javier Eguiluz <[email protected]> | ||
*/ | ||
|
@@ -31,9 +33,9 @@ public function findCrudFqcnByEntityFqcn(string $entityFqcn): ?string | |
return $this->entityFqcnToCrudFqcnMap[$entityFqcn] ?? null; | ||
} | ||
|
||
public function findEntityFqcnByCrudFqcn(string $controllerFqcn): ?string | ||
public function findEntityFqcnByCrud(CrudControllerInterface $controllerFqcn): ?string | ||
{ | ||
return $this->crudFqcnToEntityFqcnMap[$controllerFqcn] ?? null; | ||
return $this->crudFqcnToEntityFqcnMap[$controllerFqcn::class] ?? $controllerFqcn::getEntityFqcn() ?? null; | ||
} | ||
|
||
public function findCrudFqcnByCrudId(string $crudId): ?string | ||
|