Skip to content

Commit

Permalink
Move getters to AdminInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet committed Dec 19, 2020
1 parent 3091807 commit 0544967
Show file tree
Hide file tree
Showing 2 changed files with 136 additions and 122 deletions.
136 changes: 136 additions & 0 deletions src/Admin/AdminInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,45 @@

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\Builder\ShowBuilderInterface;
use Sonata\AdminBundle\Datagrid\DatagridInterface;
use Sonata\AdminBundle\Datagrid\ProxyQueryInterface;
use Sonata\AdminBundle\DependencyInjection\Admin\TaggedAdminInterface;
use Sonata\AdminBundle\Exporter\DataSourceInterface;
use Sonata\AdminBundle\Filter\Persister\FilterPersisterInterface;
use Sonata\AdminBundle\Model\ModelManagerInterface;
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 Sonata\Form\Validator\ErrorElement;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Component\Validator\Validator\ValidatorInterface;

/**
* @author Thomas Rabaix <[email protected]>
*
* NEXT_MAJOR: Add all these methods to the interface by uncommenting them.
*
* @method string getPagerType()
* @method FilterPersisterInterface|null getFilterPersister()
* @method bool hasFilterPersister()
* @method DataSourceInterface getDataSource()
* @method FormContractorInterface getFormContractor()
* @method ShowBuilderInterface getShowBuilder()
* @method Pool getConfigurationPool()
* @method RouteGeneratorInterface getRouteGenerator()
* @method array configureActionButtons(string $action, ?object $object = null)
* @method string getSearchResultLink(object $object)
* @method bool isCurrentRoute(string $name, ?string $adminCode)
Expand Down Expand Up @@ -59,6 +81,120 @@
*/
interface AdminInterface extends TaggedAdminInterface, AccessRegistryInterface, FieldDescriptionRegistryInterface, LifecycleHookProviderInterface, MenuBuilderInterface, ParentAdminInterface, UrlGeneratorInterface, MutableTemplateRegistryAwareInterface
{
/**
* @return string|null
*/
public function getLabel();

/**
* @return array<string, array<string, mixed>>
*/
public function getListModes();

/**
* NEXT_MAJOR: Uncomment this method.
*/
// public function getPagerType(): string;

/**
* @return string
*/
public function getManagerType();

/**
* 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[]> 'role' => ['permission', 'permission']
*/
public function getSecurityInformation();

/**
* NEXT_MAJOR: Uncomment this method.
*/
// public function getFilterPersister(): ?FilterPersisterInterface;

/**
* NEXT_MAJOR: Uncomment this method.
*/
// public function hasFilterPersister(): bool;

/**
* @return ModelManagerInterface
*/
public function getModelManager();

/**
* NEXT_MAJOR: Uncomment this method.
*/
// public function getDataSource(): DataSourceInterface;

/**
* NEXT_MAJOR: Uncomment this method.
*/
// public function getFormContractor(): FormContractorInterface;

/**
* NEXT_MAJOR: Uncomment this method.
*/
// public function getShowBuilder(): ShowBuilderInterface;

/**
* @return ListBuilderInterface
*/
public function getListBuilder();

/**
* @return DatagridBuilderInterface
*/
public function getDatagridBuilder();

/**
* @return TranslatorInterface
*/
public function getTranslator();

/**
* NEXT_MAJOR: Uncomment this method.
*/
// public function getConfigurationPool(): Pool;

/**
* NEXT_MAJOR: Uncomment this method.
*/
// public function getRouteGenerator(): RouteGeneratorInterface;

/**
* NEXT_MAJOR: Remove this method.
*
* @return ValidatorInterface
*
* @deprecated since sonata-project/admin-bundle 3.83 and will be removed in 4.0
*/
public function getValidator();

/**
* @return SecurityHandlerInterface
*/
public function getSecurityHandler();

/**
* @return FactoryInterface
*/
public function getMenuFactory();

/**
* @return RouteBuilderInterface
*/
public function getRouteBuilder();

/**
* @return LabelTranslatorStrategyInterface
*/
public function getLabelTranslatorStrategy();

/**
* Returns subjectClass/class/subclass name managed
* - subclass name if subclass parameter is defined
Expand Down
Loading

0 comments on commit 0544967

Please sign in to comment.