Преглед на файлове

Fix missing Admin to AbstractAdmin replaces on doc (#3825)

Sullivan SENECHAL преди 9 години
родител
ревизия
0f08d0d462

+ 1 - 1
Resources/doc/cookbook/recipe_customizing_a_mosaic_list.rst

@@ -85,7 +85,7 @@ The ``ObjectMetadata`` object is returned by the related admin class, for instan
 
     <?php
 
-    class MediaAdmin extends AdminInterface
+    class MediaAdmin extends AbstractAdmin
     {
         // [...] others methods
 

+ 1 - 1
Resources/doc/cookbook/recipe_file_uploads.rst

@@ -170,7 +170,7 @@ Both of these are straightforward when you know what to do:
     <?php
     // src/AppBundle/Admin/ImageAdmin.php
 
-    class ImageAdmin extends Admin
+    class ImageAdmin extends AbstractAdmin
     {
         protected function configureFormFields(FormMapper $formMapper)
         {

+ 1 - 1
Resources/doc/cookbook/recipe_image_previews.rst

@@ -46,7 +46,7 @@ we are manipulating form fields we do this from within ``ImageAdmin::configureFo
 
 .. code-block:: php
 
-    class ImageAdmin extends Admin
+    class ImageAdmin extends AbstractAdmin
     {
         protected function configureFormFields(FormMapper $formMapper)
         {

+ 1 - 1
Resources/doc/getting_started/the_form_view.rst

@@ -248,7 +248,7 @@ Admin class. This receives the object to transform to a string as the first para
     // ...
     use AppBundle\Entity\BlogPost;
 
-    class BlogPostAdmin extends Admin
+    class BlogPostAdmin extends AbstractAdmin
     {
         // ...
 

+ 11 - 11
Resources/doc/reference/form_types.rst

@@ -28,7 +28,7 @@ All we need to do now is add a reference for this field in our ``PageAdmin`` cla
     <?php
     // src/AppBundle/Admin/PageAdmin.php
 
-    class PageAdmin extends Admin
+    class PageAdmin extends AbstractAdmin
     {
         protected function configureFormFields(FormMapper $formMapper)
         {
@@ -111,7 +111,7 @@ identifier of related entity.
     <?php
     // src/AppBundle/Admin/PageAdmin.php
 
-    class PageAdmin extends Admin
+    class PageAdmin extends AbstractAdmin
     {
         protected function configureFormFields(FormMapper $formMapper)
         {
@@ -157,7 +157,7 @@ datagrid filter for the property ``title``.
     <?php
     // src/AppBundle/Admin/ArticleAdmin.php
 
-    class ArticleAdmin extends Admin
+    class ArticleAdmin extends AbstractAdmin
     {
         protected function configureFormFields(FormMapper $formMapper)
         {
@@ -176,7 +176,7 @@ datagrid filter for the property ``title``.
     <?php
     // src/AppBundle/Admin/CategoryAdmin.php
 
-    class CategoryAdmin extends Admin
+    class CategoryAdmin extends AbstractAdmin
     {
         protected function configureDatagridFilters(DatagridMapper $datagridMapper)
         {
@@ -301,7 +301,7 @@ template
     <?php
     // src/AppBundle/Admin/ArticleAdmin.php
 
-    class ArticleAdmin extends Admin
+    class ArticleAdmin extends AbstractAdmin
     {
         protected function configureFormFields(FormMapper $formMapper)
         {
@@ -336,7 +336,7 @@ According the choice made only associated fields are displayed. The others field
     <?php
     // src/AppBundle/Admin/AppMenuAdmin.php
 
-    class AppMenuAdmin extends Admin
+    class AppMenuAdmin extends AbstractAdmin
     {
         protected function configureFormFields(FormMapper $formMapper)
         {
@@ -415,7 +415,7 @@ for the ``image1`` field to ``sonata_type_admin`` in our ``PageAdmin`` class:
     <?php
     // src/AppBundle/Admin/PageAdmin.php
 
-    class PageAdmin extends Admin
+    class PageAdmin extends AbstractAdmin
     {
         protected function configureFormFields(FormMapper $formMapper)
         {
@@ -455,7 +455,7 @@ to the underlying forms.
     <?php
     // src/AppBundle/Admin/ProductAdmin.php
 
-    class ProductAdmin extends Admin
+    class ProductAdmin extends AbstractAdmin
     {
         protected function configureFormFields(FormMapper $formMapper)
         {
@@ -542,7 +542,7 @@ example above:
     <?php
     // src/AppBundle/Admin/PageAdmin.php
 
-    class PageAdmin extends Admin
+    class PageAdmin extends AbstractAdmin
     {
         protected function configureFormFields(FormMapper $formMapper)
         {
@@ -574,7 +574,7 @@ General
     <?php
     // src/AppBundle/Admin/PageAdmin.php
 
-    class PageAdmin extends Admin
+    class PageAdmin extends AbstractAdmin
     {
         protected function configureFormFields(FormMapper $formMapper)
         {
@@ -600,7 +600,7 @@ ChoiceType
     <?php
     // src/AppBundle/Admin/PageAdmin.php
 
-    class PageAdmin extends Admin
+    class PageAdmin extends AbstractAdmin
     {
         protected function configureFormFields(FormMapper $formMapper)
         {

+ 1 - 1
Resources/doc/reference/getting_started.rst

@@ -79,7 +79,7 @@ This is how a basic Admin class for it could look like:
     use Sonata\AdminBundle\Datagrid\ListMapper;
     use Sonata\AdminBundle\Datagrid\DatagridMapper;
 
-    class PostAdmin extends Admin
+    class PostAdmin extends AbstractAdmin
     {
         // Fields to be shown on create/edit forms
         protected function configureFormFields(FormMapper $formMapper)

+ 1 - 1
Resources/doc/reference/preview_mode.rst

@@ -11,7 +11,7 @@ The preview step can be enabled for an admin entity by overriding the public pro
     <?php
     // src/AppBundle/AdminPostAdmin.php
 
-    class PostAdmin extends Admin
+    class PostAdmin extends AbstractAdmin
     {
         public $supportsPreviewMode = true;
 

+ 14 - 14
Resources/doc/reference/routing.rst

@@ -28,7 +28,7 @@ be added to generate the actual route names.
     <?php
     // src/AppBundle/Admin/PostAdmin.php
 
-    class PostAdmin extends Admin
+    class PostAdmin extends AbstractAdmin
     {
         protected $baseRouteName = 'sonata_post';
         // will result in routes named:
@@ -52,14 +52,14 @@ If the admin class is a child of another admin class the route name will be pref
 
     <?php
     // The parent admin class
-    class PostAdmin extends Admin
+    class PostAdmin extends AbstractAdmin
     {
         protected $baseRouteName = 'sonata_post';
         // ...
     }
 
     // The child admin class
-    class CommentAdmin extends Admin
+    class CommentAdmin extends AbstractAdmin
     {
         protected $baseRouteName = 'comment'
         // will result in routes named :
@@ -84,7 +84,7 @@ use the following code:
     <?php
     // src/AppBundle/Admin/FooAdmin.php
 
-    class FooAdmin extends Admin
+    class FooAdmin extends AbstractAdmin
     {
         protected $baseRoutePattern = 'foo';
     }
@@ -98,14 +98,14 @@ If the admin class is a child of another admin class the route pattern will be p
 
     <?php
     // The parent admin class
-    class PostAdmin extends Admin
+    class PostAdmin extends AbstractAdmin
     {
         protected $baseRoutePattern = 'post';
         // ...
     }
 
     // The child admin class
-    class CommentAdmin extends Admin
+    class CommentAdmin extends AbstractAdmin
     {
         protected $baseRoutePattern = 'comment'
         // ...
@@ -155,7 +155,7 @@ explicitly this defaults to the action name.
 
     use Sonata\AdminBundle\Route\RouteCollection;
 
-    class MediaAdmin extends Admin
+    class MediaAdmin extends AbstractAdmin
     {
         protected function configureRoutes(RouteCollection $collection)
         {
@@ -177,7 +177,7 @@ in the ``add`` method to set additional settings like this:
 
     use Sonata\AdminBundle\Route\RouteCollection;
 
-    class MediaAdmin extends Admin
+    class MediaAdmin extends AbstractAdmin
     {
         protected function configureRoutes(RouteCollection $collection)
         {
@@ -271,7 +271,7 @@ Any single registered route can be easily removed by name:
 
     use Sonata\AdminBundle\Route\RouteCollection;
 
-    class MediaAdmin extends Admin
+    class MediaAdmin extends AbstractAdmin
     {
         protected function configureRoutes(RouteCollection $collection)
         {
@@ -293,7 +293,7 @@ the ``clearExcept()`` method. This method accepts an array of routes you want to
 
     use Sonata\AdminBundle\Route\RouteCollection;
 
-    class MediaAdmin extends Admin
+    class MediaAdmin extends AbstractAdmin
     {
         protected function configureRoutes(RouteCollection $collection)
         {
@@ -314,7 +314,7 @@ If you want to remove all default routes, you can use ``clear()`` method.
 
     use Sonata\AdminBundle\Route\RouteCollection;
 
-    class MediaAdmin extends Admin
+    class MediaAdmin extends AbstractAdmin
     {
         protected function configureRoutes(RouteCollection $collection)
         {
@@ -337,7 +337,7 @@ can use ``hasParentFieldDescription()`` to detect this case and remove the route
 
     use Sonata\AdminBundle\Route\RouteCollection;
 
-    class TagAdmin extends Admin
+    class TagAdmin extends AbstractAdmin
     {
         protected function configureRoutes(RouteCollection $collection)
         {
@@ -361,7 +361,7 @@ method. This method will be used when a link is being generated.
     <?php
     // src/AppBundle/Admin/MediaAdmin.php
 
-    class MediaAdmin extends Admin
+    class MediaAdmin extends AbstractAdmin
     {
         public function getPersistentParameters()
         {
@@ -390,7 +390,7 @@ list action's links to point to a different action, set the ``route`` option in
     <?php
     // src/AppBundle/Admin/PostAdmin.php
 
-    class PostAdmin extends Admin
+    class PostAdmin extends AbstractAdmin
     {
         public function configureListFields(ListMapper $listMapper)
         {

+ 1 - 1
Resources/doc/reference/saving_hooks.rst

@@ -46,7 +46,7 @@ solve the issue by using the ``preUpdate`` saving hook.
     use Sonata\AdminBundle\Admin\AbstractAdmin;
     use FOS\UserBundle\Model\UserManagerInterface;
 
-    class UserAdmin extends Admin
+    class UserAdmin extends AbstractAdmin
     {
         protected function configureFormFields(FormMapper $formMapper)
         {

+ 2 - 2
Resources/doc/reference/translation.rst

@@ -19,7 +19,7 @@ You have two options to configure the catalogue for the Admin class:
 
       <?php
 
-      class PageAdmin extends Admin
+      class PageAdmin extends AbstractAdmin
       {
           protected $translationDomain = 'SonataPageBundle'; // default is 'messages'
       }
@@ -110,7 +110,7 @@ label can be defined as the third argument of the ``add`` method:
 
 .. code-block:: php
 
-    class PageAdmin extends Admin
+    class PageAdmin extends AbstractAdmin
     {
         public function configureFormFields(FormMapper $formMapper)
         {