forked from sonata-project/SonataAdminBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
44ea2d8
commit e723524
Showing
196 changed files
with
1,993 additions
and
2,283 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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Sonata package. | ||
* This file is part of the Sonata Project package. | ||
* | ||
* (c) Thomas Rabaix <[email protected]> | ||
* | ||
|
@@ -10,54 +11,58 @@ | |
|
||
namespace Sonata\AdminBundle\Admin; | ||
|
||
use Sonata\AdminBundle\Form\FormMapper; | ||
use Sonata\AdminBundle\Datagrid\ListMapper; | ||
use Knp\Menu\ItemInterface as MenuItemInterface; | ||
use Sonata\AdminBundle\Datagrid\DatagridMapper; | ||
use Sonata\AdminBundle\Show\ShowMapper; | ||
use Sonata\AdminBundle\Datagrid\ListMapper; | ||
use Sonata\AdminBundle\Datagrid\ProxyQueryInterface; | ||
use Sonata\AdminBundle\Form\FormMapper; | ||
use Sonata\AdminBundle\Route\RouteCollection; | ||
use Sonata\AdminBundle\Show\ShowMapper; | ||
use Sonata\AdminBundle\Validator\ErrorElement; | ||
use Sonata\AdminBundle\Admin\AdminInterface; | ||
use Sonata\AdminBundle\Datagrid\ProxyQueryInterface; | ||
|
||
use Knp\Menu\ItemInterface as MenuItemInterface; | ||
|
||
abstract class AdminExtension implements AdminExtensionInterface | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function configureFormFields(FormMapper $form) | ||
{} | ||
{ | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function configureListFields(ListMapper $list) | ||
{} | ||
{ | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function configureDatagridFilters(DatagridMapper $filter) | ||
{} | ||
{ | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function configureShowFields(ShowMapper $filter) | ||
{} | ||
{ | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function configureRoutes(AdminInterface $admin, RouteCollection $collection) | ||
{} | ||
{ | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function configureSideMenu(AdminInterface $admin, MenuItemInterface $menu, $action, AdminInterface $childAdmin = null) | ||
{} | ||
{ | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
|
@@ -73,25 +78,29 @@ public function configureTabMenu(AdminInterface $admin, MenuItemInterface $menu, | |
* {@inheritdoc} | ||
*/ | ||
public function validate(AdminInterface $admin, ErrorElement $errorElement, $object) | ||
{} | ||
{ | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function configureQuery(AdminInterface $admin, ProxyQueryInterface $query, $context = 'list') | ||
{} | ||
{ | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function alterNewInstance(AdminInterface $admin, $object) | ||
{} | ||
{ | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function alterObject(AdminInterface $admin, $object) | ||
{} | ||
{ | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
|
@@ -105,35 +114,41 @@ public function getPersistentParameters(AdminInterface $admin) | |
* {@inheritdoc} | ||
*/ | ||
public function preUpdate(AdminInterface $admin, $object) | ||
{} | ||
{ | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function postUpdate(AdminInterface $admin, $object) | ||
{} | ||
{ | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function prePersist(AdminInterface $admin, $object) | ||
{} | ||
{ | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function postPersist(AdminInterface $admin, $object) | ||
{} | ||
{ | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function preRemove(AdminInterface $admin, $object) | ||
{} | ||
{ | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function postRemove(AdminInterface $admin, $object) | ||
{} | ||
{ | ||
} | ||
} |
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Sonata package. | ||
* This file is part of the Sonata Project package. | ||
* | ||
* (c) Thomas Rabaix <[email protected]> | ||
* | ||
|
@@ -10,16 +11,14 @@ | |
|
||
namespace Sonata\AdminBundle\Admin; | ||
|
||
use Sonata\AdminBundle\Form\FormMapper; | ||
use Sonata\AdminBundle\Datagrid\ListMapper; | ||
use Knp\Menu\ItemInterface as MenuItemInterface; | ||
use Sonata\AdminBundle\Datagrid\DatagridMapper; | ||
use Sonata\AdminBundle\Show\ShowMapper; | ||
use Sonata\AdminBundle\Datagrid\ListMapper; | ||
use Sonata\AdminBundle\Datagrid\ProxyQueryInterface; | ||
use Sonata\AdminBundle\Form\FormMapper; | ||
use Sonata\AdminBundle\Route\RouteCollection; | ||
use Sonata\AdminBundle\Show\ShowMapper; | ||
use Sonata\AdminBundle\Validator\ErrorElement; | ||
use Sonata\AdminBundle\Admin\AdminInterface; | ||
use Sonata\AdminBundle\Datagrid\ProxyQueryInterface; | ||
|
||
use Knp\Menu\ItemInterface as MenuItemInterface; | ||
|
||
/** | ||
* | ||
|
@@ -53,7 +52,7 @@ public function configureShowFields(ShowMapper $filter); | |
public function configureRoutes(AdminInterface $admin, RouteCollection $collection); | ||
|
||
/** | ||
* DEPRECATED: Use configureTabMenu instead | ||
* DEPRECATED: Use configureTabMenu instead. | ||
* | ||
* @param AdminInterface $admin | ||
* @param MenuItemInterface $menu | ||
|
@@ -67,7 +66,7 @@ public function configureRoutes(AdminInterface $admin, RouteCollection $collecti | |
public function configureSideMenu(AdminInterface $admin, MenuItemInterface $menu, $action, AdminInterface $childAdmin = null); | ||
|
||
/** | ||
* Builds the tab menu | ||
* Builds the tab menu. | ||
* | ||
* @param AdminInterface $admin | ||
* @param MenuItemInterface $menu | ||
|
@@ -103,18 +102,20 @@ public function configureQuery(AdminInterface $admin, ProxyQueryInterface $query | |
public function alterNewInstance(AdminInterface $admin, $object); | ||
|
||
/** | ||
* Get a chance to modify object instance | ||
* Get a chance to modify object instance. | ||
* | ||
* @param AdminInterface $admin | ||
* @param AdminInterface $admin | ||
* @param $object | ||
* | ||
* @return mixed | ||
*/ | ||
public function alterObject(AdminInterface $admin, $object); | ||
|
||
/** | ||
* Get a chance to add persistent parameters | ||
* Get a chance to add persistent parameters. | ||
* | ||
* @param AdminInterface $admin | ||
* | ||
* @param AdminInterface $admin | ||
* @return array | ||
*/ | ||
public function getPersistentParameters(AdminInterface $admin); | ||
|
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Sonata package. | ||
* This file is part of the Sonata Project package. | ||
* | ||
* (c) Thomas Rabaix <[email protected]> | ||
* | ||
|
@@ -12,12 +13,11 @@ | |
|
||
use Doctrine\Common\Inflector\Inflector; | ||
use Doctrine\Common\Util\ClassUtils; | ||
use Symfony\Component\Form\FormBuilder; | ||
use Symfony\Component\Form\FormView; | ||
use Sonata\AdminBundle\Exception\NoValueException; | ||
use Sonata\AdminBundle\Util\FormViewIterator; | ||
use Sonata\AdminBundle\Util\FormBuilderIterator; | ||
use Sonata\AdminBundle\Admin\BaseFieldDescription; | ||
use Sonata\AdminBundle\Util\FormViewIterator; | ||
use Symfony\Component\Form\FormBuilder; | ||
use Symfony\Component\Form\FormView; | ||
|
||
class AdminHelper | ||
{ | ||
|
@@ -47,7 +47,7 @@ public function getChildFormBuilder(FormBuilder $formBuilder, $elementId) | |
} | ||
} | ||
|
||
return null; | ||
return; | ||
} | ||
|
||
/** | ||
|
@@ -64,7 +64,7 @@ public function getChildFormView(FormView $formView, $elementId) | |
} | ||
} | ||
|
||
return null; | ||
return; | ||
} | ||
|
||
/** | ||
|
@@ -83,7 +83,7 @@ public function getAdmin($code) | |
* Note: | ||
* This code is ugly, but there is no better way of doing it. | ||
* For now the append form element action used to add a new row works | ||
* only for direct FieldDescription (not nested one) | ||
* only for direct FieldDescription (not nested one). | ||
* | ||
* @throws \RuntimeException | ||
* | ||
|
@@ -136,7 +136,7 @@ public function appendFormFieldElement(AdminInterface $admin, $subject, $element | |
while ($objectCount < $postCount) { | ||
// append a new instance into the object | ||
$this->addNewInstance($form->getData(), $fieldDescription); | ||
$objectCount++; | ||
++$objectCount; | ||
} | ||
|
||
$this->addNewInstance($form->getData(), $fieldDescription); | ||
|
@@ -152,7 +152,7 @@ public function appendFormFieldElement(AdminInterface $admin, $subject, $element | |
} | ||
|
||
/** | ||
* Add a new instance to the related FieldDescriptionInterface value | ||
* Add a new instance to the related FieldDescriptionInterface value. | ||
* | ||
* @param object $object | ||
* @param \Sonata\AdminBundle\Admin\FieldDescriptionInterface $fieldDescription | ||
|
@@ -182,7 +182,7 @@ public function addNewInstance($object, FieldDescriptionInterface $fieldDescript | |
} | ||
|
||
/** | ||
* Camelize a string | ||
* Camelize a string. | ||
* | ||
* @static | ||
* | ||
|
Oops, something went wrong.