Skip to content

Commit

Permalink
Fix missing Admin to AbstractAdmin replaces on doc (sonata-project#3825)
Browse files Browse the repository at this point in the history
  • Loading branch information
soullivaneuh committed May 16, 2016
1 parent adb986b commit 0f08d0d
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Resources/doc/cookbook/recipe_file_uploads.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion Resources/doc/cookbook/recipe_image_previews.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion Resources/doc/getting_started/the_form_view.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
// ...
Expand Down
22 changes: 11 additions & 11 deletions Resources/doc/reference/form_types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand All @@ -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)
{
Expand Down Expand Up @@ -301,7 +301,7 @@ template
<?php
// src/AppBundle/Admin/ArticleAdmin.php
class ArticleAdmin extends Admin
class ArticleAdmin extends AbstractAdmin
{
protected function configureFormFields(FormMapper $formMapper)
{
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -574,7 +574,7 @@ General
<?php
// src/AppBundle/Admin/PageAdmin.php
class PageAdmin extends Admin
class PageAdmin extends AbstractAdmin
{
protected function configureFormFields(FormMapper $formMapper)
{
Expand All @@ -600,7 +600,7 @@ ChoiceType
<?php
// src/AppBundle/Admin/PageAdmin.php
class PageAdmin extends Admin
class PageAdmin extends AbstractAdmin
{
protected function configureFormFields(FormMapper $formMapper)
{
Expand Down
2 changes: 1 addition & 1 deletion Resources/doc/reference/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Resources/doc/reference/preview_mode.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
28 changes: 14 additions & 14 deletions Resources/doc/reference/routing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 :
Expand All @@ -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';
}
Expand All @@ -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'
// ...
Expand Down Expand Up @@ -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)
{
Expand All @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand All @@ -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)
{
Expand All @@ -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)
{
Expand All @@ -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)
{
Expand All @@ -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()
{
Expand Down Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion Resources/doc/reference/saving_hooks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
4 changes: 2 additions & 2 deletions Resources/doc/reference/translation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
Expand Down Expand Up @@ -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)
{
Expand Down

0 comments on commit 0f08d0d

Please sign in to comment.