Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
c79ac2f7
Commit
c79ac2f7
authored
Apr 26, 2014
by
alexpott
Browse files
Issue
#2238077
by Berdir, alexpott, tim.plunkett: Rename EntityFormController to EntityForm.
parent
3937bda8
Changes
122
Hide whitespace changes
Inline
Side-by-side
core/lib/Drupal/Core/Entity/ContentEntityConfirmFormBase.php
View file @
c79ac2f7
...
...
@@ -13,7 +13,7 @@
/**
* Provides a generic base class for an entity-based confirmation form.
*/
abstract
class
ContentEntityConfirmFormBase
extends
ContentEntityForm
Controller
implements
ConfirmFormInterface
{
abstract
class
ContentEntityConfirmFormBase
extends
ContentEntityForm
implements
ConfirmFormInterface
{
/**
* {@inheritdoc}
...
...
core/lib/Drupal/Core/Entity/ContentEntityForm
Controller
.php
→
core/lib/Drupal/Core/Entity/ContentEntityForm.php
View file @
c79ac2f7
...
...
@@ -2,7 +2,7 @@
/**
* @file
* Contains \Drupal\Core\Entity\ContentEntityForm
Controller
.
* Contains \Drupal\Core\Entity\ContentEntityForm.
*/
namespace
Drupal\Core\Entity
;
...
...
@@ -12,11 +12,11 @@
use
Symfony\Component\DependencyInjection\ContainerInterface
;
/**
* Entity form
controller
variant for content entity types.
* Entity form variant for content entity types.
*
* @see \Drupal\Core\ContentEntityBase
*/
class
ContentEntityForm
Controller
extends
EntityForm
Controller
implements
ContentEntityForm
Controller
Interface
{
class
ContentEntityForm
extends
EntityForm
implements
ContentEntityFormInterface
{
/**
* The entity manager.
...
...
@@ -26,7 +26,7 @@ class ContentEntityFormController extends EntityFormController implements Conten
protected
$entityManager
;
/**
* Constructs a ContentEntityForm
Controller
object.
* Constructs a ContentEntityForm object.
*
* @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
* The entity manager.
...
...
core/lib/Drupal/Core/Entity/ContentEntityForm
Controller
Interface.php
→
core/lib/Drupal/Core/Entity/ContentEntityFormInterface.php
View file @
c79ac2f7
...
...
@@ -2,7 +2,7 @@
/**
* @file
* Contains \Drupal\Core\Entity\ContentEntityForm
Controller
Interface.
* Contains \Drupal\Core\Entity\ContentEntityFormInterface.
*/
namespace
Drupal\Core\Entity
;
...
...
@@ -10,9 +10,9 @@
use
Drupal\Core\Entity\Display\EntityFormDisplayInterface
;
/**
* Defines a common interface for content entity form
controller
classes.
* Defines a common interface for content entity form classes.
*/
interface
ContentEntityForm
Controller
Interface
extends
EntityForm
Controller
Interface
{
interface
ContentEntityFormInterface
extends
EntityFormInterface
{
/**
* Returns the form display.
...
...
core/lib/Drupal/Core/Entity/EntityConfirmFormBase.php
View file @
c79ac2f7
...
...
@@ -14,7 +14,7 @@
/**
* Provides a generic base class for an entity-based confirmation form.
*/
abstract
class
EntityConfirmFormBase
extends
EntityForm
Controller
implements
ConfirmFormInterface
{
abstract
class
EntityConfirmFormBase
extends
EntityForm
implements
ConfirmFormInterface
{
/**
* {@inheritdoc}
...
...
core/lib/Drupal/Core/Entity/EntityForm
Controller
.php
→
core/lib/Drupal/Core/Entity/EntityForm.php
View file @
c79ac2f7
...
...
@@ -2,7 +2,7 @@
/**
* @file
* Contains \Drupal\Core\Entity\EntityForm
Controller
.
* Contains \Drupal\Core\Entity\EntityForm.
*/
namespace
Drupal\Core\Entity
;
...
...
@@ -12,9 +12,9 @@
use
Drupal\Core\Render\Element
;
/**
* Base class for entity form
controller
s.
* Base class for entity forms.
*/
class
EntityForm
Controller
extends
FormBase
implements
EntityForm
Controller
Interface
{
class
EntityForm
extends
FormBase
implements
EntityFormInterface
{
/**
* The name of the current operation.
...
...
@@ -129,7 +129,7 @@ protected function init(array &$form_state) {
/**
* Returns the actual form array to be built.
*
* @see \Drupal\Core\Entity\EntityForm
Controller
::build()
* @see \Drupal\Core\Entity\EntityForm::build()
*/
public
function
form
(
array
$form
,
array
&
$form_state
)
{
$entity
=
$this
->
entity
;
...
...
@@ -152,7 +152,7 @@ public function form(array $form, array &$form_state) {
/**
* Process callback: assigns weights and hides extra fields.
*
* @see \Drupal\Core\Entity\EntityForm
Controller
::form()
* @see \Drupal\Core\Entity\EntityForm::form()
*/
public
function
processForm
(
$element
,
$form_state
,
$form
)
{
// If the form is cached, process callbacks may not have a valid reference
...
...
core/lib/Drupal/Core/Entity/EntityFormBuilder.php
View file @
c79ac2f7
...
...
@@ -45,14 +45,14 @@ public function __construct(EntityManagerInterface $entity_manager, FormBuilderI
* {@inheritdoc}
*/
public
function
getForm
(
EntityInterface
$entity
,
$operation
=
'default'
,
array
$form_state
=
array
())
{
$
controller
=
$this
->
entityManager
->
getForm
Controller
(
$entity
->
getEntityTypeId
(),
$operation
);
$
controller
->
setEntity
(
$entity
);
$
form_object
=
$this
->
entityManager
->
getForm
Object
(
$entity
->
getEntityTypeId
(),
$operation
);
$
form_object
->
setEntity
(
$entity
);
$form_state
[
'build_info'
][
'callback_object'
]
=
$
controller
;
$form_state
[
'build_info'
][
'base_form_id'
]
=
$
controller
->
getBaseFormID
();
$form_state
[
'build_info'
][
'callback_object'
]
=
$
form_object
;
$form_state
[
'build_info'
][
'base_form_id'
]
=
$
form_object
->
getBaseFormID
();
$form_state
[
'build_info'
]
+=
array
(
'args'
=>
array
());
return
$this
->
formBuilder
->
buildForm
(
$
controller
->
getFormId
(),
$form_state
);
return
$this
->
formBuilder
->
buildForm
(
$
form_object
->
getFormId
(),
$form_state
);
}
}
core/lib/Drupal/Core/Entity/EntityForm
Controller
Interface.php
→
core/lib/Drupal/Core/Entity/EntityFormInterface.php
View file @
c79ac2f7
...
...
@@ -2,7 +2,7 @@
/**
* @file
* Contains \Drupal\Core\Entity\EntityForm
Controller
Interface.
* Contains \Drupal\Core\Entity\EntityFormInterface.
*/
namespace
Drupal\Core\Entity
;
...
...
@@ -12,9 +12,9 @@
use
Drupal\Core\StringTranslation\TranslationInterface
;
/**
* Defines a common interface for entity form
controller
classes.
* Defines a common interface for entity form classes.
*/
interface
EntityForm
Controller
Interface
extends
BaseFormIdInterface
{
interface
EntityFormInterface
extends
BaseFormIdInterface
{
/**
* Returns the code identifying the active form language.
...
...
@@ -49,7 +49,7 @@ public function isDefaultFormLangcode(array $form_state);
public
function
setOperation
(
$operation
);
/**
* Returns the operation identifying the form
controller
.
* Returns the operation identifying the form.
*
* @return string
* The name of the operation.
...
...
@@ -74,7 +74,7 @@ public function getEntity();
*
* Sets the form entity which will be used for populating form element
* defaults. Usually, the form entity gets updated by
* \Drupal\Core\Entity\EntityForm
Controller
Interface::submit(), however this may
* \Drupal\Core\Entity\EntityFormInterface::submit(), however this may
* be used to completely exchange the form entity, e.g. when preparing the
* rebuild of a multi-step form.
*
...
...
@@ -92,7 +92,7 @@ public function setEntity(EntityInterface $entity);
* the submitted form values are copied to entity properties. The form's
* entity remains unchanged.
*
* @see \Drupal\Core\Entity\EntityForm
Controller
Interface::getEntity()
* @see \Drupal\Core\Entity\EntityFormInterface::getEntity()
*
* @param array $form
* A nested array form elements comprising the form.
...
...
core/lib/Drupal/Core/Entity/EntityManager.php
View file @
c79ac2f7
...
...
@@ -217,7 +217,7 @@ public function getListBuilder($entity_type) {
/**
* {@inheritdoc}
*/
public
function
getForm
Controller
(
$entity_type
,
$operation
)
{
public
function
getForm
Object
(
$entity_type
,
$operation
)
{
if
(
!
isset
(
$this
->
controllers
[
'form'
][
$operation
][
$entity_type
]))
{
if
(
!
$class
=
$this
->
getDefinition
(
$entity_type
,
TRUE
)
->
getFormClass
(
$operation
))
{
throw
new
InvalidPluginDefinitionException
(
$entity_type
,
sprintf
(
'The "%s" entity type did not specify a "%s" form class.'
,
$entity_type
,
$operation
));
...
...
core/lib/Drupal/Core/Entity/EntityManagerInterface.php
View file @
c79ac2f7
...
...
@@ -150,17 +150,17 @@ public function getViewBuilder($entity_type);
public
function
getListBuilder
(
$entity_type
);
/**
* Creates a new form
controller
instance.
* Creates a new form instance.
*
* @param string $entity_type
* The entity type for this form
controller
.
* The entity type for this form.
* @param string $operation
* The name of the operation to use, e.g., 'default'.
*
* @return \Drupal\Core\Entity\EntityForm
Controller
Interface
* A form
controller
instance.
* @return \Drupal\Core\Entity\EntityFormInterface
* A form instance.
*/
public
function
getForm
Controller
(
$entity_type
,
$operation
);
public
function
getForm
Object
(
$entity_type
,
$operation
);
/**
* Clears static and persistent field definition caches.
...
...
core/lib/Drupal/Core/Entity/EntityTypeInterface.php
View file @
c79ac2f7
...
...
@@ -202,7 +202,7 @@ public function getControllerClass($controller_type);
* operations. The name of the operation is passed also to the form
* controller's constructor, so that one class can be used for multiple
* entity forms when the forms are similar. The classes must implement
* \Drupal\Core\Entity\EntityForm
Controller
Interface.
* \Drupal\Core\Entity\EntityFormInterface.
* - list: The name of the class that provides listings of the entities. The
* class must implement \Drupal\Core\Entity\EntityListBuilderInterface.
* - render: The name of the class that is used to render the entities. The
...
...
@@ -251,7 +251,7 @@ public function getFormClass($operation);
* The operation to use this form class for.
* @param string $class
* The form class implementing
* \Drupal\Core\Entity\EntityForm
Controller
Interface.
* \Drupal\Core\Entity\EntityFormInterface.
*
* @return static
*
...
...
core/lib/Drupal/Core/Entity/HtmlEntityFormController.php
View file @
c79ac2f7
...
...
@@ -53,8 +53,8 @@ public function __construct(ControllerResolverInterface $resolver, EntityManager
* defaults:
* _entity_form: 'node.edit'
* @endcode
* This means that the edit form
controller
for the node entity will used.
* If the entity type has a default form
controller
, only the name of the
* This means that the edit form for the node entity will used.
* If the entity type has a default form, only the name of the
* entity {param} needs to be passed:
* @code
* path: '/foo/{node}/baz'
...
...
@@ -74,7 +74,7 @@ protected function getFormObject(Request $request, $form_arg) {
$entity
=
$this
->
manager
->
getStorage
(
$entity_type
)
->
create
(
array
());
}
return
$this
->
manager
->
getForm
Controller
(
$entity_type
,
$operation
)
->
setEntity
(
$entity
);
return
$this
->
manager
->
getForm
Object
(
$entity_type
,
$operation
)
->
setEntity
(
$entity
);
}
}
core/lib/Drupal/Core/Form/FormBuilderInterface.php
View file @
c79ac2f7
...
...
@@ -195,7 +195,7 @@ public function getForm($form_arg);
* storage. The recommended way to ensure that the chosen key doesn't
* conflict with ones used by the Form API or other modules is to use the
* module name as the key name or a prefix for the key name. For example,
* the entity form
controller
classes use $this->entity in entity forms,
* the entity form classes use $this->entity in entity forms,
* or $form_state['controller']->getEntity() outside the controller, to
* store information about the entity being edited, and this information
* stays available across successive clicks of the "Preview" button (if
...
...
core/modules/action/action.module
View file @
c79ac2f7
...
...
@@ -50,8 +50,8 @@ function action_permission() {
function
action_entity_type_build
(
array
&
$entity_types
)
{
/** @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */
$entity_types
[
'action'
]
->
setFormClass
(
'add'
,
'Drupal\action\ActionAddForm
Controller
'
)
->
setFormClass
(
'edit'
,
'Drupal\action\ActionEditForm
Controller
'
)
->
setFormClass
(
'add'
,
'Drupal\action\ActionAddForm'
)
->
setFormClass
(
'edit'
,
'Drupal\action\ActionEditForm'
)
->
setFormClass
(
'delete'
,
'Drupal\action\Form\ActionDeleteForm'
)
->
setListBuilderClass
(
'Drupal\action\ActionListBuilder'
)
->
setLinkTemplate
(
'delete-form'
,
'action.delete'
)
...
...
core/modules/action/lib/Drupal/action/ActionAddForm
Controller
.php
→
core/modules/action/lib/Drupal/action/ActionAddForm.php
View file @
c79ac2f7
...
...
@@ -2,7 +2,7 @@
/**
* @file
* Contains \Drupal\action\ActionAddForm
Controller
.
* Contains \Drupal\action\ActionAddForm.
*/
namespace
Drupal\action
;
...
...
@@ -13,9 +13,9 @@
use
Symfony\Component\DependencyInjection\ContainerInterface
;
/**
* Provides a form
controller
for action add forms.
* Provides a form for action add forms.
*/
class
ActionAddForm
Controller
extends
ActionForm
Controller
Base
{
class
ActionAddForm
extends
ActionFormBase
{
/**
* The action manager.
...
...
@@ -25,7 +25,7 @@ class ActionAddFormController extends ActionFormControllerBase {
protected
$actionManager
;
/**
* Constructs a new ActionAddForm
Controller
.
* Constructs a new ActionAddForm.
*
* @param \Drupal\Core\Entity\EntityStorageInterface $storage
* The action storage.
...
...
core/modules/action/lib/Drupal/action/ActionEditForm.php
0 → 100644
View file @
c79ac2f7
<?php
/**
* @file
* Contains Drupal\action\ActionEditForm.
*/
namespace
Drupal\action
;
/**
* Provides a form for action edit forms.
*/
class
ActionEditForm
extends
ActionFormBase
{
}
core/modules/action/lib/Drupal/action/ActionEditFormController.php
deleted
100644 → 0
View file @
3937bda8
<?php
/**
* @file
* Contains Drupal\action\ActionEditFormController.
*/
namespace
Drupal\action
;
/**
* Provides a form controller for action edit forms.
*/
class
ActionEditFormController
extends
ActionFormControllerBase
{
}
core/modules/action/lib/Drupal/action/ActionForm
Controller
Base.php
→
core/modules/action/lib/Drupal/action/ActionFormBase.php
View file @
c79ac2f7
...
...
@@ -2,20 +2,20 @@
/**
* @file
* Contains Drupal\action\ActionEditForm
Controller
.
* Contains Drupal\action\ActionEditForm.
*/
namespace
Drupal\action
;
use
Drupal\Core\Entity\EntityForm
Controller
;
use
Drupal\Core\Entity\EntityForm
;
use
Drupal\Core\Entity\EntityStorageInterface
;
use
Drupal\Core\Plugin\PluginFormInterface
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
/**
* Provides a base form
controller
for action forms.
* Provides a base form for action forms.
*/
abstract
class
ActionForm
Controller
Base
extends
EntityForm
Controller
{
abstract
class
ActionFormBase
extends
EntityForm
{
/**
* The action plugin being configured.
...
...
core/modules/aggregator/lib/Drupal/aggregator/Entity/Feed.php
View file @
c79ac2f7
...
...
@@ -24,7 +24,7 @@
* "storage" = "Drupal\aggregator\FeedStorage",
* "view_builder" = "Drupal\aggregator\FeedViewBuilder",
* "form" = {
* "default" = "Drupal\aggregator\FeedForm
Controller
",
* "default" = "Drupal\aggregator\FeedForm",
* "delete" = "Drupal\aggregator\Form\FeedDeleteForm",
* "delete_items" = "Drupal\aggregator\Form\FeedItemsDeleteForm",
* }
...
...
core/modules/aggregator/lib/Drupal/aggregator/FeedForm
Controller
.php
→
core/modules/aggregator/lib/Drupal/aggregator/FeedForm.php
View file @
c79ac2f7
...
...
@@ -2,13 +2,13 @@
/**
* @file
* Contains \Drupal\aggregator\FeedForm
Controller
.
* Contains \Drupal\aggregator\FeedForm.
*/
namespace
Drupal\aggregator
;
use
Drupal\Component\Utility\String
;
use
Drupal\Core\Entity\ContentEntityForm
Controller
;
use
Drupal\Core\Entity\ContentEntityForm
;
use
Drupal\Core\Entity\EntityManagerInterface
;
use
Drupal\Core\Language\Language
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
...
...
@@ -16,7 +16,7 @@
/**
* Form controller for the aggregator feed edit forms.
*/
class
FeedForm
Controller
extends
ContentEntityForm
Controller
{
class
FeedForm
extends
ContentEntityForm
{
/**
* {@inheritdoc}
...
...
core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockForm
Controller
.php
→
core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockForm.php
View file @
c79ac2f7
...
...
@@ -2,13 +2,13 @@
/**
* @file
* Contains \Drupal\custom_block\CustomBlockForm
Controller
.
* Contains \Drupal\custom_block\CustomBlockForm.
*/
namespace
Drupal\custom_block
;
use
Drupal\Core\Cache\Cache
;
use
Drupal\Core\Entity\ContentEntityForm
Controller
;
use
Drupal\Core\Entity\ContentEntityForm
;
use
Drupal\Core\Entity\EntityManagerInterface
;
use
Drupal\Core\Entity\EntityStorageInterface
;
use
Drupal\Core\Language\Language
;
...
...
@@ -18,7 +18,7 @@
/**
* Form controller for the custom block edit forms.
*/
class
CustomBlockForm
Controller
extends
ContentEntityForm
Controller
{
class
CustomBlockForm
extends
ContentEntityForm
{
/**
* The custom block storage.
...
...
@@ -35,7 +35,7 @@ class CustomBlockFormController extends ContentEntityFormController {
protected
$languageManager
;
/**
* Constructs a CustomBlockForm
Controller
object.
* Constructs a CustomBlockForm object.
*
* @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
* The entity manager.
...
...
@@ -63,7 +63,7 @@ public static function create(ContainerInterface $container) {
}
/**
* Overrides \Drupal\Core\Entity\EntityForm
Controller
::prepareEntity().
* Overrides \Drupal\Core\Entity\EntityForm::prepareEntity().
*
* Prepares the custom block object.
*
...
...
@@ -167,7 +167,7 @@ public function form(array $form, array &$form_state) {
}
/**
* Overrides \Drupal\Core\Entity\EntityForm
Controller
::submit().
* Overrides \Drupal\Core\Entity\EntityForm::submit().
*
* Updates the custom block object by processing the submitted values.
*
...
...
Prev
1
2
3
4
5
…
7
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment