|
@@ -12,14 +12,11 @@
|
|
|
namespace Sonata\AdminBundle\Admin;
|
|
|
|
|
|
use Knp\Menu\FactoryInterface as MenuFactoryInterface;
|
|
|
-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\ProxyQueryInterface;
|
|
|
-use Sonata\AdminBundle\Route\RouteCollection;
|
|
|
-use Sonata\AdminBundle\Route\RouteGeneratorInterface;
|
|
|
use Sonata\AdminBundle\Security\Handler\SecurityHandlerInterface;
|
|
|
use Sonata\AdminBundle\Translator\LabelTranslatorStrategyInterface;
|
|
|
use Sonata\CoreBundle\Model\Metadata;
|
|
@@ -34,8 +31,18 @@ use Symfony\Component\Validator\ValidatorInterface as LegacyValidatorInterface;
|
|
|
/**
|
|
|
* @author Thomas Rabaix <thomas.rabaix@sonata-project.org>
|
|
|
*/
|
|
|
-interface AdminInterface
|
|
|
+interface AdminInterface extends AccessRegistryInterface, FieldDescriptionRegistryInterface, LifecycleHookProviderInterface, MenuBuilderInterface, ParentAdminInterface, UrlGeneratorInterface
|
|
|
{
|
|
|
+ /**
|
|
|
+ * @param MenuFactoryInterface $menuFactory
|
|
|
+ */
|
|
|
+ public function setMenuFactory(MenuFactoryInterface $menuFactory);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return MenuFactoryInterface
|
|
|
+ */
|
|
|
+ public function getMenuFactory();
|
|
|
+
|
|
|
/**
|
|
|
* @param FormContractorInterface $formContractor
|
|
|
*/
|
|
@@ -93,11 +100,6 @@ interface AdminInterface
|
|
|
*/
|
|
|
public function setConfigurationPool(Pool $pool);
|
|
|
|
|
|
- /**
|
|
|
- * @param RouteGeneratorInterface $routeGenerator
|
|
|
- */
|
|
|
- public function setRouteGenerator(RouteGeneratorInterface $routeGenerator);
|
|
|
-
|
|
|
/**
|
|
|
* Returns subjectClass/class/subclass name managed
|
|
|
* - subclass name if subclass parameter is defined
|
|
@@ -132,40 +134,6 @@ interface AdminInterface
|
|
|
*/
|
|
|
public function getBaseControllerName();
|
|
|
|
|
|
- /**
|
|
|
- * Generates the object url with the given $name.
|
|
|
- *
|
|
|
- * @param string $name
|
|
|
- * @param mixed $object
|
|
|
- * @param array $parameters
|
|
|
- * @param bool $absolute
|
|
|
- *
|
|
|
- * @return string return a complete url
|
|
|
- */
|
|
|
- public function generateObjectUrl($name, $object, array $parameters = array(), $absolute = false);
|
|
|
-
|
|
|
- /**
|
|
|
- * Generates an url for the given parameters.
|
|
|
- *
|
|
|
- * @param string $name
|
|
|
- * @param array $parameters
|
|
|
- * @param bool $absolute
|
|
|
- *
|
|
|
- * @return string return a complete url
|
|
|
- */
|
|
|
- public function generateUrl($name, array $parameters = array(), $absolute = false);
|
|
|
-
|
|
|
- /**
|
|
|
- * Generates an url for the given parameters.
|
|
|
- *
|
|
|
- * @param string $name
|
|
|
- * @param array $parameters
|
|
|
- * @param bool $absolute
|
|
|
- *
|
|
|
- * @return array return url parts: 'route', 'routeParameters', 'routeAbsolute'
|
|
|
- */
|
|
|
- public function generateMenuUrl($name, array $parameters = array(), $absolute = false);
|
|
|
-
|
|
|
/**
|
|
|
* @return \Sonata\AdminBundle\Model\ModelManagerInterface
|
|
|
*/
|
|
@@ -188,22 +156,6 @@ interface AdminInterface
|
|
|
*/
|
|
|
public function getFormBuilder();
|
|
|
|
|
|
- /**
|
|
|
- * Return FormFieldDescription.
|
|
|
- *
|
|
|
- * @param string $name
|
|
|
- *
|
|
|
- * @return FieldDescriptionInterface
|
|
|
- */
|
|
|
- public function getFormFieldDescription($name);
|
|
|
-
|
|
|
- /**
|
|
|
- * Build and return the collection of form FieldDescription.
|
|
|
- *
|
|
|
- * @return array collection of form FieldDescription
|
|
|
- */
|
|
|
- public function getFormFieldDescriptions();
|
|
|
-
|
|
|
/**
|
|
|
* Returns a form depend on the given $object.
|
|
|
*
|
|
@@ -279,20 +231,6 @@ interface AdminInterface
|
|
|
*/
|
|
|
public function trans($id, array $parameters = array(), $domain = null, $locale = null);
|
|
|
|
|
|
- /**
|
|
|
- * Returns the list of available urls.
|
|
|
- *
|
|
|
- * @return RouteCollection the list of available urls
|
|
|
- */
|
|
|
- public function getRoutes();
|
|
|
-
|
|
|
- /**
|
|
|
- * Return the parameter name used to represent the id in the url.
|
|
|
- *
|
|
|
- * @return string
|
|
|
- */
|
|
|
- public function getRouterIdParameter();
|
|
|
-
|
|
|
/**
|
|
|
* Returns the parameter representing request id, ie: id or childId.
|
|
|
*
|
|
@@ -326,92 +264,6 @@ interface AdminInterface
|
|
|
*/
|
|
|
// public function isCurrentRoute($name, $adminCode = null);
|
|
|
|
|
|
- /**
|
|
|
- * Returns true if the admin has a FieldDescription with the given $name.
|
|
|
- *
|
|
|
- * @param string $name
|
|
|
- *
|
|
|
- * @return bool
|
|
|
- */
|
|
|
- public function hasShowFieldDescription($name);
|
|
|
-
|
|
|
- /**
|
|
|
- * add a FieldDescription.
|
|
|
- *
|
|
|
- * @param string $name
|
|
|
- * @param FieldDescriptionInterface $fieldDescription
|
|
|
- */
|
|
|
- public function addShowFieldDescription($name, FieldDescriptionInterface $fieldDescription);
|
|
|
-
|
|
|
- /**
|
|
|
- * Remove a ShowFieldDescription.
|
|
|
- *
|
|
|
- * @param string $name
|
|
|
- */
|
|
|
- public function removeShowFieldDescription($name);
|
|
|
-
|
|
|
- /**
|
|
|
- * add a list FieldDescription.
|
|
|
- *
|
|
|
- * @param string $name
|
|
|
- * @param FieldDescriptionInterface $fieldDescription
|
|
|
- */
|
|
|
- public function addListFieldDescription($name, FieldDescriptionInterface $fieldDescription);
|
|
|
-
|
|
|
- /**
|
|
|
- * Remove a list FieldDescription.
|
|
|
- *
|
|
|
- * @param string $name
|
|
|
- */
|
|
|
- public function removeListFieldDescription($name);
|
|
|
-
|
|
|
- /**
|
|
|
- * Returns true if the filter FieldDescription exists.
|
|
|
- *
|
|
|
- * @param string $name
|
|
|
- *
|
|
|
- * @return bool
|
|
|
- */
|
|
|
- public function hasFilterFieldDescription($name);
|
|
|
-
|
|
|
- /**
|
|
|
- * add a filter FieldDescription.
|
|
|
- *
|
|
|
- * @param string $name
|
|
|
- * @param FieldDescriptionInterface $fieldDescription
|
|
|
- */
|
|
|
- public function addFilterFieldDescription($name, FieldDescriptionInterface $fieldDescription);
|
|
|
-
|
|
|
- /**
|
|
|
- * Remove a filter FieldDescription.
|
|
|
- *
|
|
|
- * @param string $name
|
|
|
- */
|
|
|
- public function removeFilterFieldDescription($name);
|
|
|
-
|
|
|
- /**
|
|
|
- * Returns the filter FieldDescription collection.
|
|
|
- *
|
|
|
- * @return FieldDescriptionInterface[]
|
|
|
- */
|
|
|
- public function getFilterFieldDescriptions();
|
|
|
-
|
|
|
- /**
|
|
|
- * Returns a filter FieldDescription.
|
|
|
- *
|
|
|
- * @param string $name
|
|
|
- *
|
|
|
- * @return FieldDescriptionInterface|null
|
|
|
- */
|
|
|
- public function getFilterFieldDescription($name);
|
|
|
-
|
|
|
- /**
|
|
|
- * Returns a list depend on the given $object.
|
|
|
- *
|
|
|
- * @return FieldDescriptionCollection
|
|
|
- */
|
|
|
- public function getList();
|
|
|
-
|
|
|
/**
|
|
|
* @param SecurityHandlerInterface $securityHandler
|
|
|
*/
|
|
@@ -430,13 +282,6 @@ interface AdminInterface
|
|
|
*/
|
|
|
public function isGranted($name, $object = null);
|
|
|
|
|
|
- /**
|
|
|
- * @param mixed $entity
|
|
|
- *
|
|
|
- * @return string a string representation of the id that is save to use in an url
|
|
|
- */
|
|
|
- public function getUrlsafeIdentifier($entity);
|
|
|
-
|
|
|
/**
|
|
|
* @param mixed $entity
|
|
|
*
|
|
@@ -500,16 +345,6 @@ interface AdminInterface
|
|
|
*/
|
|
|
public function getExtensions();
|
|
|
|
|
|
- /**
|
|
|
- * @param \Knp\Menu\FactoryInterface $menuFactory
|
|
|
- */
|
|
|
- public function setMenuFactory(MenuFactoryInterface $menuFactory);
|
|
|
-
|
|
|
- /**
|
|
|
- * @return \Knp\Menu\FactoryInterface
|
|
|
- */
|
|
|
- public function getMenuFactory();
|
|
|
-
|
|
|
/**
|
|
|
* @param RouteBuilderInterface $routeBuilder
|
|
|
*/
|
|
@@ -546,38 +381,6 @@ interface AdminInterface
|
|
|
*/
|
|
|
public function supportsPreviewMode();
|
|
|
|
|
|
- /**
|
|
|
- * add an Admin child to the current one.
|
|
|
- *
|
|
|
- * @param AdminInterface $child
|
|
|
- */
|
|
|
- public function addChild(AdminInterface $child);
|
|
|
-
|
|
|
- /**
|
|
|
- * Returns true or false if an Admin child exists for the given $code.
|
|
|
- *
|
|
|
- * @param string $code Admin code
|
|
|
- *
|
|
|
- * @return bool True if child exist, false otherwise
|
|
|
- */
|
|
|
- public function hasChild($code);
|
|
|
-
|
|
|
- /**
|
|
|
- * Returns an collection of admin children.
|
|
|
- *
|
|
|
- * @return array list of Admin children
|
|
|
- */
|
|
|
- public function getChildren();
|
|
|
-
|
|
|
- /**
|
|
|
- * Returns an admin child with the given $code.
|
|
|
- *
|
|
|
- * @param string $code
|
|
|
- *
|
|
|
- * @return AdminInterface|null
|
|
|
- */
|
|
|
- public function getChild($code);
|
|
|
-
|
|
|
/**
|
|
|
* @return mixed a new object instance
|
|
|
*/
|
|
@@ -653,61 +456,6 @@ interface AdminInterface
|
|
|
|
|
|
public function configure();
|
|
|
|
|
|
- /**
|
|
|
- * @param mixed $object
|
|
|
- *
|
|
|
- * @return mixed
|
|
|
- */
|
|
|
- public function update($object);
|
|
|
-
|
|
|
- /**
|
|
|
- * @param mixed $object
|
|
|
- *
|
|
|
- * @return mixed
|
|
|
- */
|
|
|
- public function create($object);
|
|
|
-
|
|
|
- /**
|
|
|
- * @param mixed $object
|
|
|
- */
|
|
|
- public function delete($object);
|
|
|
-
|
|
|
- //TODO: uncomment this method for 4.0
|
|
|
- // /**
|
|
|
- // * @param mixed $object
|
|
|
- // */
|
|
|
- // public function preValidate($object);
|
|
|
-
|
|
|
- /**
|
|
|
- * @param mixed $object
|
|
|
- */
|
|
|
- public function preUpdate($object);
|
|
|
-
|
|
|
- /**
|
|
|
- * @param mixed $object
|
|
|
- */
|
|
|
- public function postUpdate($object);
|
|
|
-
|
|
|
- /**
|
|
|
- * @param mixed $object
|
|
|
- */
|
|
|
- public function prePersist($object);
|
|
|
-
|
|
|
- /**
|
|
|
- * @param mixed $object
|
|
|
- */
|
|
|
- public function postPersist($object);
|
|
|
-
|
|
|
- /**
|
|
|
- * @param mixed $object
|
|
|
- */
|
|
|
- public function preRemove($object);
|
|
|
-
|
|
|
- /**
|
|
|
- * @param mixed $object
|
|
|
- */
|
|
|
- public function postRemove($object);
|
|
|
-
|
|
|
/**
|
|
|
* Call before the batch action, allow you to alter the query and the idx.
|
|
|
*
|
|
@@ -963,28 +711,6 @@ interface AdminInterface
|
|
|
*/
|
|
|
public function getTranslationLabel($label, $context = '', $type = '');
|
|
|
|
|
|
- /**
|
|
|
- * NEXT_MAJOR: remove this method.
|
|
|
- *
|
|
|
- * @param string $action
|
|
|
- * @param AdminInterface $childAdmin
|
|
|
- *
|
|
|
- * @return ItemInterface|bool
|
|
|
- *
|
|
|
- * @deprecated Use buildTabMenu instead
|
|
|
- */
|
|
|
- public function buildSideMenu($action, AdminInterface $childAdmin = null);
|
|
|
-
|
|
|
- /**
|
|
|
- * Build the tab menu related to the current action.
|
|
|
- *
|
|
|
- * @param string $action
|
|
|
- * @param AdminInterface $childAdmin
|
|
|
- *
|
|
|
- * @return ItemInterface|bool
|
|
|
- */
|
|
|
- public function buildTabMenu($action, AdminInterface $childAdmin = null);
|
|
|
-
|
|
|
/**
|
|
|
* @param $object
|
|
|
*
|
|
@@ -1009,21 +735,6 @@ interface AdminInterface
|
|
|
*/
|
|
|
public function getListMode();
|
|
|
|
|
|
- /**
|
|
|
- * Return the controller access mapping.
|
|
|
- *
|
|
|
- * @return array
|
|
|
- */
|
|
|
- public function getAccessMapping();
|
|
|
-
|
|
|
- /**
|
|
|
- * Hook to handle access authorization.
|
|
|
- *
|
|
|
- * @param string $action
|
|
|
- * @param object $object
|
|
|
- */
|
|
|
- public function checkAccess($action, $object = null);
|
|
|
-
|
|
|
/*
|
|
|
* Configure buttons for an action
|
|
|
*
|
|
@@ -1033,17 +744,6 @@ interface AdminInterface
|
|
|
*/
|
|
|
// public function configureActionButtons($action, $object = null);
|
|
|
|
|
|
-// TODO: uncomment this method for next major release
|
|
|
-// /**
|
|
|
-// * Hook to handle access authorization, without throw Exception
|
|
|
-// *
|
|
|
-// * @param string $action
|
|
|
-// * @param object $object
|
|
|
-// *
|
|
|
-// * @return bool
|
|
|
-// */
|
|
|
-// public function hasAccess($action, $object = null);
|
|
|
-
|
|
|
//TODO: uncomment this method for 4.0
|
|
|
/*
|
|
|
* Returns the result link for an object.
|