-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
1,389 additions
and
683 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -13,58 +13,28 @@ | |
|
||
namespace Sonata\AdminBundle\Admin; | ||
|
||
use Knp\Menu\FactoryInterface; | ||
use Knp\Menu\ItemInterface; | ||
use Sonata\AdminBundle\Builder\DatagridBuilderInterface; | ||
use Sonata\AdminBundle\Builder\FormContractorInterface; | ||
use Sonata\AdminBundle\Builder\ListBuilderInterface; | ||
use Sonata\AdminBundle\Builder\RouteBuilderInterface; | ||
use Sonata\AdminBundle\Datagrid\DatagridInterface; | ||
use Sonata\AdminBundle\Datagrid\ProxyQueryInterface; | ||
use Sonata\AdminBundle\Exporter\DataSourceInterface; | ||
use Sonata\AdminBundle\Filter\Persister\FilterPersisterInterface; | ||
use Sonata\AdminBundle\Model\ModelManagerInterface; | ||
use Sonata\AdminBundle\DependencyInjection\Admin\TaggedAdminInterface; | ||
use Sonata\AdminBundle\Object\MetadataInterface; | ||
use Sonata\AdminBundle\Route\RouteGeneratorInterface; | ||
use Sonata\AdminBundle\Security\Handler\SecurityHandlerInterface; | ||
use Sonata\AdminBundle\Templating\MutableTemplateRegistryAwareInterface; | ||
use Sonata\AdminBundle\Translator\LabelTranslatorStrategyInterface; | ||
use Sonata\Exporter\Source\SourceIteratorInterface; | ||
use Symfony\Component\Form\FormBuilderInterface; | ||
use Symfony\Component\Form\FormInterface; | ||
use Symfony\Component\HttpFoundation\Request; | ||
use Symfony\Contracts\Translation\TranslatorInterface; | ||
|
||
/** | ||
* @author Thomas Rabaix <[email protected]> | ||
* | ||
* @phpstan-template T of object | ||
* @phpstan-extends TaggedAdminInterface<T> | ||
* @phpstan-extends AccessRegistryInterface<T> | ||
* @phpstan-extends UrlGeneratorInterface<T> | ||
* @phpstan-extends LifecycleHookProviderInterface<T> | ||
*/ | ||
interface AdminInterface extends AccessRegistryInterface, FieldDescriptionRegistryInterface, LifecycleHookProviderInterface, MenuBuilderInterface, ParentAdminInterface, UrlGeneratorInterface, MutableTemplateRegistryAwareInterface | ||
interface AdminInterface extends TaggedAdminInterface, AccessRegistryInterface, FieldDescriptionRegistryInterface, LifecycleHookProviderInterface, MenuBuilderInterface, ParentAdminInterface, UrlGeneratorInterface, MutableTemplateRegistryAwareInterface | ||
{ | ||
public function setMenuFactory(FactoryInterface $menuFactory): void; | ||
|
||
public function getMenuFactory(): ?FactoryInterface; | ||
|
||
public function setFormContractor(FormContractorInterface $formContractor): void; | ||
|
||
public function setListBuilder(ListBuilderInterface $listBuilder): void; | ||
|
||
public function getListBuilder(): ?ListBuilderInterface; | ||
|
||
public function setDatagridBuilder(DatagridBuilderInterface $datagridBuilder): void; | ||
|
||
public function getDatagridBuilder(): ?DatagridBuilderInterface; | ||
|
||
public function setTranslator(TranslatorInterface $translator): void; | ||
|
||
public function setRequest(Request $request): void; | ||
|
||
public function setConfigurationPool(Pool $pool): void; | ||
|
||
/** | ||
* Returns subjectClass/class/subclass name managed | ||
* - subclass name if subclass parameter is defined | ||
|
@@ -79,8 +49,6 @@ public function attachAdminClass(FieldDescriptionInterface $fieldDescription): v | |
|
||
public function getDatagrid(): DatagridInterface; | ||
|
||
public function getPagerType(): string; | ||
|
||
/** | ||
* Set base controller name. | ||
*/ | ||
|
@@ -98,29 +66,22 @@ public function getBaseControllerName(): string; | |
*/ | ||
public function setTemplates(array $templates): void; | ||
|
||
public function getDataSource(): ?DataSourceInterface; | ||
|
||
/** | ||
* Sets a specific template. | ||
*/ | ||
public function setTemplate(string $name, string $template): void; | ||
|
||
public function getModelManager(): ?ModelManagerInterface; | ||
|
||
public function getManagerType(): ?string; | ||
|
||
public function createQuery(): ProxyQueryInterface; | ||
|
||
/** | ||
* @return FormBuilderInterface the form builder | ||
*/ | ||
public function getFormBuilder(): FormBuilderInterface; | ||
|
||
/** | ||
* Returns a form depend on the given $object. | ||
*/ | ||
public function getForm(): FormInterface; | ||
|
||
public function setRequest(Request $request): void; | ||
|
||
public function getRequest(): Request; | ||
|
||
/** | ||
|
@@ -132,16 +93,6 @@ public function getCode(): string; | |
|
||
public function getBaseCodeRoute(): string; | ||
|
||
/** | ||
* Return the roles and permissions per role | ||
* - different permissions per role for the acl handler | ||
* - one permission that has the same name as the role for the role handler | ||
* This should be used by experimented users. | ||
* | ||
* @return array<string, string[]|string> 'role' => ['permission', 'permission'] | ||
*/ | ||
public function getSecurityInformation(): array; | ||
|
||
public function setParentFieldDescription(FieldDescriptionInterface $parentFieldDescription): void; | ||
|
||
/** | ||
|
@@ -164,10 +115,6 @@ public function getIdParameter(): string; | |
*/ | ||
public function hasRoute(string $name): bool; | ||
|
||
public function setSecurityHandler(SecurityHandlerInterface $securityHandler): void; | ||
|
||
public function getSecurityHandler(): ?SecurityHandlerInterface; | ||
|
||
/** | ||
* @param string|string[] $name | ||
* | ||
|
@@ -191,13 +138,13 @@ public function id(object $model): ?string; | |
|
||
public function getShow(): FieldDescriptionCollection; | ||
|
||
public function getList(): FieldDescriptionCollection; | ||
|
||
/** | ||
* @param string[] $formTheme | ||
*/ | ||
public function setFormTheme(array $formTheme): void; | ||
|
||
public function getList(): FieldDescriptionCollection; | ||
|
||
/** | ||
* @return string[] | ||
*/ | ||
|
@@ -222,19 +169,11 @@ public function addExtension(AdminExtensionInterface $extension): void; | |
*/ | ||
public function getExtensions(): array; | ||
|
||
public function setRouteBuilder(RouteBuilderInterface $routeBuilder): void; | ||
|
||
public function getRouteBuilder(): ?RouteBuilderInterface; | ||
|
||
/** | ||
* @phpstan-param T $object | ||
*/ | ||
public function toString(object $object): string; | ||
|
||
public function setLabelTranslatorStrategy(LabelTranslatorStrategyInterface $labelTranslatorStrategy): void; | ||
|
||
public function getLabelTranslatorStrategy(): ?LabelTranslatorStrategyInterface; | ||
|
||
/** | ||
* Returning true will enable preview mode for | ||
* the target entity and show a preview button | ||
|
@@ -267,6 +206,11 @@ public function setSubject(?object $subject): void; | |
|
||
public function getSubject(): object; | ||
|
||
/** | ||
* Return true if the Admin is related to a subject. | ||
*/ | ||
public function hasSubject(): bool; | ||
|
||
/** | ||
* Returns the array of allowed export formats. | ||
* | ||
|
@@ -297,11 +241,6 @@ public function preBatchAction(string $actionName, ProxyQueryInterface $query, a | |
*/ | ||
public function getFilterParameters(): array; | ||
|
||
/** | ||
* Return true if the Admin is related to a subject. | ||
*/ | ||
public function hasSubject(): bool; | ||
|
||
public function showIn(string $context): bool; | ||
|
||
/** | ||
|
@@ -334,6 +273,11 @@ public function getFormGroups(): array; | |
*/ | ||
public function setFormGroups(array $formGroups): void; | ||
|
||
/** | ||
* @param string[] $keys | ||
*/ | ||
public function reorderFormGroup(string $group, array $keys): void; | ||
|
||
/** | ||
* @return array<string, mixed> | ||
*/ | ||
|
@@ -431,11 +375,6 @@ public function getActiveSubclassCode(): string; | |
*/ | ||
public function getBatchActions(): array; | ||
|
||
/** | ||
* Returns Admin`s label. | ||
*/ | ||
public function getLabel(): ?string; | ||
|
||
/** | ||
* Returns an array of persistent parameters. | ||
* | ||
|
@@ -508,12 +447,6 @@ public function isCurrentRoute(string $name, ?string $adminCode = null): bool; | |
*/ | ||
public function getSearchResultLink(object $object): ?string; | ||
|
||
/** | ||
* Setting to true will enable mosaic button for the admin screen. | ||
* Setting to false will hide mosaic button for the admin screen. | ||
*/ | ||
public function showMosaicButton(bool $isShown): void; | ||
|
||
/** | ||
* @param array<string, array<string, mixed>> $buttonList | ||
* | ||
|
@@ -538,8 +471,6 @@ public function getRoot(): self; | |
*/ | ||
public function getRootCode(): string; | ||
|
||
public function setFilterPersister(?FilterPersisterInterface $filterPersister = null): void; | ||
|
||
/** | ||
* Returns the baseRoutePattern used to generate the routing information. | ||
* | ||
|
@@ -558,23 +489,16 @@ public function getSideMenu(string $action, ?self $childAdmin = null): ItemInter | |
|
||
public function addParentAssociationMapping(string $code, string $value): void; | ||
|
||
public function getRouteGenerator(): ?RouteGeneratorInterface; | ||
|
||
/** | ||
* Returns the current child admin instance. | ||
*/ | ||
public function getCurrentChildAdmin(): ?self; | ||
|
||
/** | ||
* Returns the name of the parent related field, so the field can be use to set the default | ||
* value (ie the parent object) or to filter the object. | ||
*/ | ||
public function getParentAssociationMapping(): ?string; | ||
|
||
/** | ||
* @param string[] $keys | ||
* Returns the current child admin instance. | ||
*/ | ||
public function reorderFormGroup(string $group, array $keys): void; | ||
public function getCurrentChildAdmin(): ?self; | ||
|
||
/** | ||
* This method is being called by the main admin class and the child class, | ||
|
Oops, something went wrong.