Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
299
Merge Requests
299
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
4b7bbecb
Commit
4b7bbecb
authored
Oct 25, 2013
by
alexpott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2097903
by Berdir, amateescu: Rename EntityRenderController to EntityViewBuilder.
parent
e01957ff
Changes
72
Hide whitespace changes
Inline
Side-by-side
Showing
72 changed files
with
263 additions
and
336 deletions
+263
-336
core/includes/entity.inc
core/includes/entity.inc
+5
-21
core/lib/Drupal/Core/Entity/Annotation/EntityType.php
core/lib/Drupal/Core/Entity/Annotation/EntityType.php
+1
-1
core/lib/Drupal/Core/Entity/Controller/EntityViewController.php
...ib/Drupal/Core/Entity/Controller/EntityViewController.php
+1
-1
core/lib/Drupal/Core/Entity/Entity.php
core/lib/Drupal/Core/Entity/Entity.php
+2
-2
core/lib/Drupal/Core/Entity/EntityManager.php
core/lib/Drupal/Core/Entity/EntityManager.php
+6
-6
core/lib/Drupal/Core/Entity/EntityViewBuilder.php
core/lib/Drupal/Core/Entity/EntityViewBuilder.php
+5
-5
core/lib/Drupal/Core/Entity/EntityViewBuilderInterface.php
core/lib/Drupal/Core/Entity/EntityViewBuilderInterface.php
+2
-2
core/modules/aggregator/lib/Drupal/aggregator/Controller/AggregatorController.php
...lib/Drupal/aggregator/Controller/AggregatorController.php
+4
-4
core/modules/aggregator/lib/Drupal/aggregator/Entity/Feed.php
.../modules/aggregator/lib/Drupal/aggregator/Entity/Feed.php
+1
-1
core/modules/aggregator/lib/Drupal/aggregator/Entity/Item.php
.../modules/aggregator/lib/Drupal/aggregator/Entity/Item.php
+1
-1
core/modules/aggregator/lib/Drupal/aggregator/FeedViewBuilder.php
...ules/aggregator/lib/Drupal/aggregator/FeedViewBuilder.php
+4
-4
core/modules/aggregator/lib/Drupal/aggregator/Form/AggregatorCategorizeFormBase.php
...b/Drupal/aggregator/Form/AggregatorCategorizeFormBase.php
+7
-10
core/modules/aggregator/lib/Drupal/aggregator/ItemViewBuilder.php
...ules/aggregator/lib/Drupal/aggregator/ItemViewBuilder.php
+4
-4
core/modules/aggregator/lib/Drupal/aggregator/Plugin/aggregator/processor/DefaultProcessor.php
...gregator/Plugin/aggregator/processor/DefaultProcessor.php
+1
-1
core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockViewBuilder.php
..._block/lib/Drupal/custom_block/CustomBlockViewBuilder.php
+4
-4
core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlock.php
...stom_block/lib/Drupal/custom_block/Entity/CustomBlock.php
+1
-1
core/modules/block/lib/Drupal/block/BlockPluginInterface.php
core/modules/block/lib/Drupal/block/BlockPluginInterface.php
+1
-1
core/modules/block/lib/Drupal/block/BlockViewBuilder.php
core/modules/block/lib/Drupal/block/BlockViewBuilder.php
+7
-7
core/modules/block/lib/Drupal/block/Entity/Block.php
core/modules/block/lib/Drupal/block/Entity/Block.php
+1
-1
core/modules/book/lib/Drupal/book/BookExport.php
core/modules/book/lib/Drupal/book/BookExport.php
+5
-5
core/modules/comment/comment.module
core/modules/comment/comment.module
+3
-3
core/modules/comment/lib/Drupal/comment/CommentFormController.php
...ules/comment/lib/Drupal/comment/CommentFormController.php
+2
-2
core/modules/comment/lib/Drupal/comment/CommentViewBuilder.php
...modules/comment/lib/Drupal/comment/CommentViewBuilder.php
+7
-6
core/modules/comment/lib/Drupal/comment/Controller/CommentController.php
...mment/lib/Drupal/comment/Controller/CommentController.php
+2
-2
core/modules/comment/lib/Drupal/comment/Entity/Comment.php
core/modules/comment/lib/Drupal/comment/Entity/Comment.php
+1
-1
core/modules/comment/lib/Drupal/comment/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php
...t/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php
+9
-9
core/modules/comment/lib/Drupal/comment/Tests/CommentNonNodeTest.php
...s/comment/lib/Drupal/comment/Tests/CommentNonNodeTest.php
+29
-29
core/modules/contact/lib/Drupal/contact/Entity/Message.php
core/modules/contact/lib/Drupal/contact/Entity/Message.php
+1
-1
core/modules/contact/lib/Drupal/contact/MessageViewBuilder.php
...modules/contact/lib/Drupal/contact/MessageViewBuilder.php
+5
-5
core/modules/entity/lib/Drupal/entity/Controller/EntityDisplayModeController.php
.../Drupal/entity/Controller/EntityDisplayModeController.php
+1
-1
core/modules/entity/lib/Drupal/entity/EntityDisplayBase.php
core/modules/entity/lib/Drupal/entity/EntityDisplayBase.php
+2
-2
core/modules/entity/lib/Drupal/entity/EntityDisplayModeListController.php
...ity/lib/Drupal/entity/EntityDisplayModeListController.php
+1
-1
core/modules/entity/lib/Drupal/entity/Form/EntityDisplayModeAddForm.php
...ntity/lib/Drupal/entity/Form/EntityDisplayModeAddForm.php
+1
-1
core/modules/entity/lib/Drupal/entity/Tests/EntityDisplayModeTest.php
.../entity/lib/Drupal/entity/Tests/EntityDisplayModeTest.php
+4
-4
core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceFormatterTest.php
...l/entity_reference/Tests/EntityReferenceFormatterTest.php
+2
-2
core/modules/file/lib/Drupal/file/Entity/File.php
core/modules/file/lib/Drupal/file/Entity/File.php
+1
-1
core/modules/menu_link/lib/Drupal/menu_link/Entity/MenuLink.php
...odules/menu_link/lib/Drupal/menu_link/Entity/MenuLink.php
+1
-1
core/modules/node/lib/Drupal/node/Controller/NodeController.php
...odules/node/lib/Drupal/node/Controller/NodeController.php
+1
-1
core/modules/node/lib/Drupal/node/Entity/Node.php
core/modules/node/lib/Drupal/node/Entity/Node.php
+1
-1
core/modules/node/lib/Drupal/node/NodeViewBuilder.php
core/modules/node/lib/Drupal/node/NodeViewBuilder.php
+5
-5
core/modules/node/lib/Drupal/node/Plugin/Search/NodeSearch.php
...modules/node/lib/Drupal/node/Plugin/Search/NodeSearch.php
+2
-2
core/modules/node/lib/Drupal/node/Tests/SummaryLengthTest.php
.../modules/node/lib/Drupal/node/Tests/SummaryLengthTest.php
+1
-1
core/modules/rdf/lib/Drupal/rdf/Entity/RdfMapping.php
core/modules/rdf/lib/Drupal/rdf/Entity/RdfMapping.php
+1
-1
core/modules/rdf/lib/Drupal/rdf/Tests/Field/FieldRdfaDatatypeCallbackTest.php
.../Drupal/rdf/Tests/Field/FieldRdfaDatatypeCallbackTest.php
+2
-2
core/modules/rdf/lib/Drupal/rdf/Tests/Field/FieldRdfaTestBase.php
...ules/rdf/lib/Drupal/rdf/Tests/Field/FieldRdfaTestBase.php
+4
-4
core/modules/rdf/lib/Drupal/rdf/Tests/Field/TaxonomyTermReferenceRdfaTest.php
.../Drupal/rdf/Tests/Field/TaxonomyTermReferenceRdfaTest.php
+5
-5
core/modules/system/lib/Drupal/system/Tests/Entity/EntityManagerTest.php
...stem/lib/Drupal/system/Tests/Entity/EntityManagerTest.php
+1
-1
core/modules/system/lib/Drupal/system/Tests/Entity/EntityUriTest.php
...s/system/lib/Drupal/system/Tests/Entity/EntityUriTest.php
+2
-2
core/modules/system/lib/Drupal/system/Tests/Entity/EntityViewBuilderTest.php
.../lib/Drupal/system/Tests/Entity/EntityViewBuilderTest.php
+20
-20
core/modules/system/lib/Drupal/system/Tests/Entity/EntityViewControllerTest.php
...b/Drupal/system/Tests/Entity/EntityViewControllerTest.php
+13
-22
core/modules/system/tests/modules/entity_test/config/entity.view_mode.entity_test.full.yml
.../entity_test/config/entity.view_mode.entity_test.full.yml
+5
-0
core/modules/system/tests/modules/entity_test/config/entity.view_mode.entity_test.test.yml
.../entity_test/config/entity.view_mode.entity_test.test.yml
+5
-0
core/modules/system/tests/modules/entity_test/entity_test.module
...dules/system/tests/modules/entity_test/entity_test.module
+2
-18
core/modules/system/tests/modules/entity_test/entity_test.routing.yml
.../system/tests/modules/entity_test/entity_test.routing.yml
+7
-7
core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTest.php
.../entity_test/lib/Drupal/entity_test/Entity/EntityTest.php
+8
-1
core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTestLabel.php
...ty_test/lib/Drupal/entity_test/Entity/EntityTestLabel.php
+1
-1
core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTestRender.php
...y_test/lib/Drupal/entity_test/Entity/EntityTestRender.php
+0
-45
core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/EntityTestViewBuilder.php
...ity_test/lib/Drupal/entity_test/EntityTestViewBuilder.php
+5
-5
core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Plugin/Derivative/EntityTestLocalTasks.php
...al/entity_test/Plugin/Derivative/EntityTestLocalTasks.php
+0
-1
core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Routing/RouteSubscriber.php
...y_test/lib/Drupal/entity_test/Routing/RouteSubscriber.php
+0
-1
core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Term.php
core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Term.php
+1
-1
core/modules/taxonomy/lib/Drupal/taxonomy/TermViewBuilder.php
.../modules/taxonomy/lib/Drupal/taxonomy/TermViewBuilder.php
+6
-6
core/modules/tour/lib/Drupal/tour/Entity/Tour.php
core/modules/tour/lib/Drupal/tour/Entity/Tour.php
+1
-1
core/modules/tour/lib/Drupal/tour/TourViewBuilder.php
core/modules/tour/lib/Drupal/tour/TourViewBuilder.php
+5
-5
core/modules/user/lib/Drupal/user/Entity/User.php
core/modules/user/lib/Drupal/user/Entity/User.php
+1
-1
core/modules/user/user.module
core/modules/user/user.module
+2
-2
core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsEntityRow.php
...ews/lib/Drupal/views/Plugin/Derivative/ViewsEntityRow.php
+1
-1
core/modules/views/lib/Drupal/views/Tests/Handler/AreaEntityTest.php
...s/views/lib/Drupal/views/Tests/Handler/AreaEntityTest.php
+7
-7
core/modules/views/lib/Drupal/views/Tests/QueryGroupByTest.php
...modules/views/lib/Drupal/views/Tests/QueryGroupByTest.php
+1
-1
core/modules/views/tests/modules/views_test_config/test_views/views.view.test_entity_area.yml
...ws_test_config/test_views/views.view.test_entity_area.yml
+6
-6
core/modules/views/views.views.inc
core/modules/views/views.views.inc
+1
-1
core/tests/Drupal/Tests/Core/Entity/Controller/EntityViewControllerTest.php
...Tests/Core/Entity/Controller/EntityViewControllerTest.php
+5
-5
No files found.
core/includes/entity.inc
View file @
4b7bbecb
...
...
@@ -52,8 +52,8 @@ function entity_info_cache_clear() {
function
entity_render_cache_clear
()
{
$entity_manager
=
Drupal
::
entityManager
();
foreach
(
$entity_manager
->
getDefinitions
()
as
$entity_type
=>
$info
)
{
if
(
$entity_manager
->
hasController
(
$entity_type
,
'
ren
der'
))
{
$entity_manager
->
get
RenderControll
er
(
$entity_type
)
->
resetCache
();
if
(
$entity_manager
->
hasController
(
$entity_type
,
'
view_buil
der'
))
{
$entity_manager
->
get
ViewBuild
er
(
$entity_type
)
->
resetCache
();
}
}
}
...
...
@@ -435,7 +435,7 @@ function entity_page_label(EntityInterface $entity, $langcode = NULL) {
* @return \Drupal\Core\Entity\EntityAccessControllerInterface
* An entity access controller instance.
*
* @deprecated Use \Drupal\Core\Entity\EntityManager::get
Render
Controller().
* @deprecated Use \Drupal\Core\Entity\EntityManager::get
Access
Controller().
*/
function
entity_access_controller
(
$entity_type
)
{
return
\
Drupal
::
entityManager
()
...
...
@@ -551,22 +551,6 @@ function entity_list_controller($entity_type) {
->
getListController
(
$entity_type
);
}
/**
* Returns an entity render controller for a given entity type.
*
* @param string $entity_type
* The type of the entity.
*
* @return \Drupal\Core\Entity\EntityRenderControllerInterface
* An entity render controller.
*
* @deprecated Use \Drupal\Core\Entity\EntityManager::getFormController().
*/
function
entity_render_controller
(
$entity_type
)
{
return
\
Drupal
::
entityManager
()
->
getRenderController
(
$entity_type
);
}
/**
* Returns the render array for an entity.
*
...
...
@@ -585,7 +569,7 @@ function entity_render_controller($entity_type) {
* A render array for the entity.
*/
function
entity_view
(
EntityInterface
$entity
,
$view_mode
,
$langcode
=
NULL
,
$reset
=
FALSE
)
{
$render_controller
=
\
Drupal
::
entityManager
()
->
get
RenderControll
er
(
$entity
->
entityType
());
$render_controller
=
\
Drupal
::
entityManager
()
->
get
ViewBuild
er
(
$entity
->
entityType
());
if
(
$reset
)
{
$render_controller
->
resetCache
(
array
(
$entity
->
id
()));
}
...
...
@@ -611,7 +595,7 @@ function entity_view(EntityInterface $entity, $view_mode, $langcode = NULL, $res
* entities array passed in $entities.
*/
function
entity_view_multiple
(
array
$entities
,
$view_mode
,
$langcode
=
NULL
,
$reset
=
FALSE
)
{
$render_controller
=
\
Drupal
::
entityManager
()
->
get
RenderControll
er
(
reset
(
$entities
)
->
entityType
());
$render_controller
=
\
Drupal
::
entityManager
()
->
get
ViewBuild
er
(
reset
(
$entities
)
->
entityType
());
if
(
$reset
)
{
$render_controller
->
resetCache
(
array_keys
(
$entities
));
}
...
...
core/lib/Drupal/Core/Entity/Annotation/EntityType.php
View file @
4b7bbecb
...
...
@@ -57,7 +57,7 @@ class EntityType extends Plugin {
* - list: The name of the class that provides listings of the entities. The
* class must implement \Drupal\Core\Entity\EntityListControllerInterface.
* - render: The name of the class that is used to render the entities. The
* class must implement \Drupal\Core\Entity\Entity
RenderControll
erInterface.
* class must implement \Drupal\Core\Entity\Entity
ViewBuild
erInterface.
* - access: The name of the class that is used for access checks. The class
* must implement \Drupal\Core\Entity\EntityAccessControllerInterface.
* Defaults to \Drupal\Core\Entity\EntityAccessController.
...
...
core/lib/Drupal/Core/Entity/Controller/EntityViewController.php
View file @
4b7bbecb
...
...
@@ -62,7 +62,7 @@ public static function create(ContainerInterface $container) {
*/
public
function
view
(
EntityInterface
$_entity
,
$view_mode
=
'full'
,
$langcode
=
NULL
)
{
return
$this
->
entityManager
->
get
RenderControll
er
(
$_entity
->
entityType
())
->
get
ViewBuild
er
(
$_entity
->
entityType
())
->
view
(
$_entity
,
$view_mode
,
$langcode
);
}
...
...
core/lib/Drupal/Core/Entity/Entity.php
View file @
4b7bbecb
...
...
@@ -364,8 +364,8 @@ public function changed() {
}
foreach
(
$referenced_entity_ids
as
$entity_type
=>
$entity_ids
)
{
if
(
\
Drupal
::
entityManager
()
->
hasController
(
$entity_type
,
'
ren
der'
))
{
\
Drupal
::
entityManager
()
->
get
RenderControll
er
(
$entity_type
)
->
resetCache
(
array_keys
(
$entity_ids
));
if
(
\
Drupal
::
entityManager
()
->
hasController
(
$entity_type
,
'
view_buil
der'
))
{
\
Drupal
::
entityManager
()
->
get
ViewBuild
er
(
$entity_type
)
->
resetCache
(
array_keys
(
$entity_ids
));
}
}
}
...
...
core/lib/Drupal/Core/Entity/EntityManager.php
View file @
4b7bbecb
...
...
@@ -307,16 +307,16 @@ public function getFormController($entity_type, $operation) {
}
/**
* Creates a new
render controll
er instance.
* Creates a new
view build
er instance.
*
* @param string $entity_type
* The entity type for this
render controll
er.
* The entity type for this
view build
er.
*
* @return \Drupal\Core\Entity\Entity
RenderControll
erInterface.
* A
render controll
er instance.
* @return \Drupal\Core\Entity\Entity
ViewBuild
erInterface.
* A
view build
er instance.
*/
public
function
get
RenderControll
er
(
$entity_type
)
{
return
$this
->
getController
(
$entity_type
,
'
ren
der'
);
public
function
get
ViewBuild
er
(
$entity_type
)
{
return
$this
->
getController
(
$entity_type
,
'
view_buil
der'
);
}
/**
...
...
core/lib/Drupal/Core/Entity/Entity
RenderControll
er.php
→
core/lib/Drupal/Core/Entity/Entity
ViewBuild
er.php
View file @
4b7bbecb
...
...
@@ -2,7 +2,7 @@
/**
* @file
* Contains \Drupal\Core\Entity\Entity
RenderControll
er.
* Contains \Drupal\Core\Entity\Entity
ViewBuild
er.
*/
namespace
Drupal\Core\Entity
;
...
...
@@ -13,7 +13,7 @@
/**
* Base class for entity view controllers.
*/
class
Entity
RenderController
implements
EntityRenderControll
erInterface
{
class
Entity
ViewBuilder
implements
EntityViewBuild
erInterface
{
/**
* The type of entities for which this controller is instantiated.
...
...
@@ -56,7 +56,7 @@ public function __construct($entity_type) {
}
/**
*
Implements \Drupal\Core\Entity\EntityRenderControllerInterface::buildContent().
*
{@inheritdoc}
*/
public
function
buildContent
(
array
$entities
,
array
$displays
,
$view_mode
,
$langcode
=
NULL
)
{
field_attach_prepare_view
(
$this
->
entityType
,
$entities
,
$displays
,
$langcode
);
...
...
@@ -148,7 +148,7 @@ protected function getBuildDefaults(EntityInterface $entity, $view_mode, $langco
protected
function
alterBuild
(
array
&
$build
,
EntityInterface
$entity
,
EntityDisplay
$display
,
$view_mode
,
$langcode
=
NULL
)
{
}
/**
*
Implements \Drupal\Core\Entity\EntityRenderControllerInterface::view().
*
{@inheritdoc}
*/
public
function
view
(
EntityInterface
$entity
,
$view_mode
=
'full'
,
$langcode
=
NULL
)
{
$buildList
=
$this
->
viewMultiple
(
array
(
$entity
),
$view_mode
,
$langcode
);
...
...
@@ -156,7 +156,7 @@ public function view(EntityInterface $entity, $view_mode = 'full', $langcode = N
}
/**
*
Implements \Drupal\Core\Entity\EntityRenderControllerInterface::viewMultiple().
*
{@inheritdoc}
*/
public
function
viewMultiple
(
array
$entities
=
array
(),
$view_mode
=
'full'
,
$langcode
=
NULL
)
{
if
(
!
isset
(
$langcode
))
{
...
...
core/lib/Drupal/Core/Entity/Entity
RenderControll
erInterface.php
→
core/lib/Drupal/Core/Entity/Entity
ViewBuild
erInterface.php
View file @
4b7bbecb
...
...
@@ -2,7 +2,7 @@
/**
* @file
* Contains \Drupal\Core\Entity\Entity
RenderControll
erInterface.
* Contains \Drupal\Core\Entity\Entity
ViewBuild
erInterface.
*/
namespace
Drupal\Core\Entity
;
...
...
@@ -10,7 +10,7 @@
/**
* Defines a common interface for entity view controller classes.
*/
interface
Entity
RenderControll
erInterface
{
interface
Entity
ViewBuild
erInterface
{
/**
* Build the structured $content property on the entity.
...
...
core/modules/aggregator/lib/Drupal/aggregator/Controller/AggregatorController.php
View file @
4b7bbecb
...
...
@@ -85,7 +85,7 @@ public function feedAdd() {
*/
public
function
viewFeed
(
FeedInterface
$aggregator_feed
)
{
$entity_manager
=
$this
->
entityManager
();
$feed_source
=
$entity_manager
->
get
RenderControll
er
(
'aggregator_feed'
)
$feed_source
=
$entity_manager
->
get
ViewBuild
er
(
'aggregator_feed'
)
->
view
(
$aggregator_feed
,
'default'
);
// Load aggregator feed item for the particular feed id.
$items
=
$entity_manager
->
getStorageController
(
'aggregator_item'
)
->
loadByFeed
(
$aggregator_feed
->
id
());
...
...
@@ -131,7 +131,7 @@ protected function buildPageList(array $items, $feed_source = '') {
);
$build
[
'feed_source'
]
=
is_array
(
$feed_source
)
?
$feed_source
:
array
(
'#markup'
=>
$feed_source
);
if
(
$items
)
{
$build
[
'items'
]
=
$this
->
entityManager
()
->
get
RenderControll
er
(
'aggregator_item'
)
$build
[
'items'
]
=
$this
->
entityManager
()
->
get
ViewBuild
er
(
'aggregator_item'
)
->
viewMultiple
(
$items
,
'default'
);
$build
[
'pager'
]
=
array
(
'#theme'
=>
'pager'
);
}
...
...
@@ -274,7 +274,7 @@ public function categories() {
if
(
$aggregator_summary_items
)
{
$items
=
$entity_manager
->
getStorageController
(
'aggregator_item'
)
->
loadByCategory
(
$category
->
cid
);
if
(
$items
)
{
$summary_items
=
$entity_manager
->
get
RenderControll
er
(
'aggregator_item'
)
->
viewMultiple
(
$items
,
'summary'
);
$summary_items
=
$entity_manager
->
get
ViewBuild
er
(
'aggregator_item'
)
->
viewMultiple
(
$items
,
'summary'
);
}
}
$category
->
url
=
$this
->
urlGenerator
()
->
generateFromPath
(
'aggregator/categories/'
.
$category
->
cid
);
...
...
@@ -326,7 +326,7 @@ public function sources() {
$items
=
$entity_manager
->
getStorageController
(
'aggregator_item'
)
->
loadByFeed
(
$feed
->
id
());
if
(
$items
)
{
$summary_items
=
$entity_manager
->
get
RenderControll
er
(
'aggregator_item'
)
$summary_items
=
$entity_manager
->
get
ViewBuild
er
(
'aggregator_item'
)
->
viewMultiple
(
$items
,
'summary'
);
}
}
...
...
core/modules/aggregator/lib/Drupal/aggregator/Entity/Feed.php
View file @
4b7bbecb
...
...
@@ -23,7 +23,7 @@
* module = "aggregator",
* controllers = {
* "storage" = "Drupal\aggregator\FeedStorageController",
* "
render" = "Drupal\aggregator\FeedRenderControll
er",
* "
view_builder" = "Drupal\aggregator\FeedViewBuild
er",
* "form" = {
* "default" = "Drupal\aggregator\FeedFormController",
* "delete" = "Drupal\aggregator\Form\FeedDeleteForm",
...
...
core/modules/aggregator/lib/Drupal/aggregator/Entity/Item.php
View file @
4b7bbecb
...
...
@@ -22,7 +22,7 @@
* module = "aggregator",
* controllers = {
* "storage" = "Drupal\aggregator\ItemStorageController",
* "
render" = "Drupal\aggregator\ItemRenderControll
er"
* "
view_builder" = "Drupal\aggregator\ItemViewBuild
er"
* },
* base_table = "aggregator_item",
* fieldable = TRUE,
...
...
core/modules/aggregator/lib/Drupal/aggregator/Feed
RenderControll
er.php
→
core/modules/aggregator/lib/Drupal/aggregator/Feed
ViewBuild
er.php
View file @
4b7bbecb
...
...
@@ -2,21 +2,21 @@
/**
* @file
* Contains \Drupal\aggregator\Feed
RenderControll
er.
* Contains \Drupal\aggregator\Feed
ViewBuild
er.
*/
namespace
Drupal\aggregator
;
use
Drupal\Core\Entity\EntityInterface
;
use
Drupal\Core\Entity\Entity
RenderControll
er
;
use
Drupal\Core\Entity\Entity
ViewBuild
er
;
/**
* Render controller for aggregator feed items.
*/
class
Feed
RenderController
extends
EntityRenderControll
er
{
class
Feed
ViewBuilder
extends
EntityViewBuild
er
{
/**
*
Overrides Drupal\Core\Entity\EntityRenderController::getBuildDefaults().
*
{@inheritdoc}
*/
protected
function
getBuildDefaults
(
EntityInterface
$entity
,
$view_mode
,
$langcode
)
{
$defaults
=
parent
::
getBuildDefaults
(
$entity
,
$view_mode
,
$langcode
);
...
...
core/modules/aggregator/lib/Drupal/aggregator/Form/AggregatorCategorizeFormBase.php
View file @
4b7bbecb
...
...
@@ -11,7 +11,7 @@
use
Drupal\aggregator\FeedInterface
;
use
Drupal\aggregator\ItemStorageControllerInterface
;
use
Drupal\Component\Utility\String
;
use
Drupal\Core\Entity\Entity
RenderControll
erInterface
;
use
Drupal\Core\Entity\Entity
ViewBuild
erInterface
;
use
Drupal\Core\Form\FormBase
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
...
...
@@ -21,9 +21,9 @@
abstract
class
AggregatorCategorizeFormBase
extends
FormBase
{
/**
* The aggregator item
render controll
er.
* The aggregator item
view build
er.
*
* @var \Drupal\Core\Entity\Entity
RenderControll
erInterface
* @var \Drupal\Core\Entity\Entity
ViewBuild
erInterface
*/
protected
$aggregatorItemRenderer
;
...
...
@@ -58,26 +58,23 @@ abstract class AggregatorCategorizeFormBase extends FormBase {
/**
* Constructs a \Drupal\aggregator\Controller\AggregatorController object.
*
* @param \Drupal\Core\Entity\Entity
RenderControll
erInterface $aggregator_item_renderer
* The item
render controll
er.
* @param \Drupal\Core\Entity\Entity
ViewBuild
erInterface $aggregator_item_renderer
* The item
view build
er.
* @param \Drupal\aggregator\ItemStorageControllerInterface $aggregator_item_storage
* The aggregator item storage controller.
* @param \Drupal\aggregator\CategoryStorageControllerInterface $category_storage
* The category storage controller.
*/
public
function
__construct
(
Entity
RenderControll
erInterface
$aggregator_item_renderer
,
ItemStorageControllerInterface
$aggregator_item_storage
,
CategoryStorageControllerInterface
$category_storage
)
{
public
function
__construct
(
Entity
ViewBuild
erInterface
$aggregator_item_renderer
,
ItemStorageControllerInterface
$aggregator_item_storage
,
CategoryStorageControllerInterface
$category_storage
)
{
$this
->
aggregatorItemRenderer
=
$aggregator_item_renderer
;
$this
->
config
=
$this
->
config
(
'aggregator.settings'
);
$this
->
aggregatorItemStorage
=
$aggregator_item_storage
;
$this
->
categoryStorage
=
$category_storage
;
}
/**
* {@inheritdoc}
*/
public
static
function
create
(
ContainerInterface
$container
)
{
return
new
static
(
$container
->
get
(
'plugin.manager.entity'
)
->
get
RenderControll
er
(
'aggregator_item'
),
$container
->
get
(
'plugin.manager.entity'
)
->
get
ViewBuild
er
(
'aggregator_item'
),
$container
->
get
(
'plugin.manager.entity'
)
->
getStorageController
(
'aggregator_item'
),
$container
->
get
(
'aggregator.category.storage'
)
);
...
...
core/modules/aggregator/lib/Drupal/aggregator/Item
RenderControll
er.php
→
core/modules/aggregator/lib/Drupal/aggregator/Item
ViewBuild
er.php
View file @
4b7bbecb
...
...
@@ -2,21 +2,21 @@
/**
* @file
* Contains \Drupal\aggregator\Item
RenderControll
er.
* Contains \Drupal\aggregator\Item
ViewBuild
er.
*/
namespace
Drupal\aggregator
;
use
Drupal\Core\Entity\EntityInterface
;
use
Drupal\Core\Entity\Entity
RenderControll
er
;
use
Drupal\Core\Entity\Entity
ViewBuild
er
;
/**
* Render controller for aggregator feed items.
*/
class
Item
RenderController
extends
EntityRenderControll
er
{
class
Item
ViewBuilder
extends
EntityViewBuild
er
{
/**
*
Overrides Drupal\Core\Entity\EntityRenderController::getBuildDefaults().
*
{@inheritdoc}
*/
protected
function
getBuildDefaults
(
EntityInterface
$entity
,
$view_mode
,
$langcode
)
{
$defaults
=
parent
::
getBuildDefaults
(
$entity
,
$view_mode
,
$langcode
);
...
...
core/modules/aggregator/lib/Drupal/aggregator/Plugin/aggregator/processor/DefaultProcessor.php
View file @
4b7bbecb
...
...
@@ -143,7 +143,7 @@ public function process(Feed $feed) {
return
;
}
foreach
(
$feed
->
items
as
$item
)
{
// @todo: The default entity
render controll
er always returns an empty
// @todo: The default entity
view build
er always returns an empty
// array, which is ignored in aggregator_save_item() currently. Should
// probably be fixed.
if
(
empty
(
$item
[
'title'
]))
{
...
...
core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlock
RenderControll
er.php
→
core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlock
ViewBuild
er.php
View file @
4b7bbecb
...
...
@@ -2,22 +2,22 @@
/**
* @file
* Contains \Drupal\custom_block\CustomBlock
RenderControll
er.
* Contains \Drupal\custom_block\CustomBlock
ViewBuild
er.
*/
namespace
Drupal\custom_block
;
use
Drupal\Core\Entity\EntityInterface
;
use
Drupal\Core\Entity\Entity
RenderControll
er
;
use
Drupal\Core\Entity\Entity
ViewBuild
er
;
use
Drupal\entity\Entity\EntityDisplay
;
/**
* Render controller for custom blocks.
*/
class
CustomBlock
RenderController
extends
EntityRenderControll
er
{
class
CustomBlock
ViewBuilder
extends
EntityViewBuild
er
{
/**
*
Overrides \Drupal\Core\Entity\EntityRenderController::alterBuild().
*
{@inheritdoc}
*/
protected
function
alterBuild
(
array
&
$build
,
EntityInterface
$entity
,
EntityDisplay
$display
,
$view_mode
,
$langcode
=
NULL
)
{
parent
::
alterBuild
(
$build
,
$entity
,
$display
,
$view_mode
,
$langcode
);
...
...
core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlock.php
View file @
4b7bbecb
...
...
@@ -25,7 +25,7 @@
* "storage" = "Drupal\custom_block\CustomBlockStorageController",
* "access" = "Drupal\custom_block\CustomBlockAccessController",
* "list" = "Drupal\custom_block\CustomBlockListController",
* "
render" = "Drupal\custom_block\CustomBlockRenderControll
er",
* "
view_builder" = "Drupal\custom_block\CustomBlockViewBuild
er",
* "form" = {
* "add" = "Drupal\custom_block\CustomBlockFormController",
* "edit" = "Drupal\custom_block\CustomBlockFormController",
...
...
core/modules/block/lib/Drupal/block/BlockPluginInterface.php
View file @
4b7bbecb
...
...
@@ -44,7 +44,7 @@ public function access(AccountInterface $account);
* @return array
* A renderable array representing the content of the block.
*
* @see \Drupal\block\Block
RenderControll
er
* @see \Drupal\block\Block
ViewBuild
er
*/
public
function
build
();
...
...
core/modules/block/lib/Drupal/block/Block
RenderControll
er.php
→
core/modules/block/lib/Drupal/block/Block
ViewBuild
er.php
View file @
4b7bbecb
...
...
@@ -2,28 +2,28 @@
/**
* @file
* Contains \Drupal\block\Block
RenderControll
er.
* Contains \Drupal\block\Block
ViewBuild
er.
*/
namespace
Drupal\block
;
use
Drupal\Core\Entity\Entity
RenderControll
erInterface
;
use
Drupal\Core\Entity\Entity
ViewBuild
erInterface
;
use
Drupal\Core\Entity\EntityInterface
;
/**
* Provides a Block
render controll
er.
* Provides a Block
view build
er.
*/
class
Block
RenderController
implements
EntityRenderControll
erInterface
{
class
Block
ViewBuilder
implements
EntityViewBuild
erInterface
{
/**
*
Implements \Drupal\Core\Entity\EntityRenderControllerInterface::buildContent().
*
{@inheritdoc}
*/
public
function
buildContent
(
array
$entities
,
array
$displays
,
$view_mode
,
$langcode
=
NULL
)
{
return
array
();
}
/**
*
Implements Drupal\Core\Entity\EntityRenderControllerInterface::view().
*
{@inheritdoc}
*/
public
function
view
(
EntityInterface
$entity
,
$view_mode
=
'full'
,
$langcode
=
NULL
)
{
$build
=
$this
->
viewMultiple
(
array
(
$entity
),
$view_mode
,
$langcode
);
...
...
@@ -31,7 +31,7 @@ public function view(EntityInterface $entity, $view_mode = 'full', $langcode = N
}
/**
*
Implements Drupal\Core\Entity\EntityRenderControllerInterface::viewMultiple().
*
{@inheritdoc}
*/
public
function
viewMultiple
(
array
$entities
=
array
(),
$view_mode
=
'full'
,
$langcode
=
NULL
)
{
$build
=
array
();
...
...
core/modules/block/lib/Drupal/block/Entity/Block.php
View file @
4b7bbecb
...
...
@@ -24,7 +24,7 @@
* controllers = {
* "storage" = "Drupal\Core\Config\Entity\ConfigStorageController",
* "access" = "Drupal\block\BlockAccessController",
* "
render" = "Drupal\block\BlockRenderControll
er",
* "
view_builder" = "Drupal\block\BlockViewBuild
er",
* "list" = "Drupal\block\BlockListController",
* "form" = {
* "default" = "Drupal\block\BlockFormController",
...
...
core/modules/book/lib/Drupal/book/BookExport.php
View file @
4b7bbecb
...
...
@@ -26,11 +26,11 @@ class BookExport {
protected
$nodeStorage
;
/**
* The node
render controll
er.
* The node
view build
er.
*
* @var \Drupal\Core\Entity\Entity
RenderControll
erInterface
* @var \Drupal\Core\Entity\Entity
ViewBuild
erInterface
*/
protected
$
nodeRen
der
;
protected
$
viewBuil
der
;
/**
* Constructs a BookExport object.
...
...
@@ -40,7 +40,7 @@ class BookExport {
*/
public
function
__construct
(
EntityManager
$entityManager
)
{
$this
->
nodeStorage
=
$entityManager
->
getStorageController
(
'node'
);
$this
->
nodeRender
=
$entityManager
->
getRenderControll
er
(
'node'
);
$this
->
viewBuilder
=
$entityManager
->
getViewBuild
er
(
'node'
);
}
/**
...
...
@@ -125,7 +125,7 @@ protected function exportTraverse(array $tree, $callable) {
* @see \Drupal\book\BookExport::exportTraverse()
*/
protected
function
bookNodeExport
(
NodeInterface
$node
,
$children
=
''
)
{
$build
=
$this
->
nodeRen
der
->
view
(
$node
,
'print'
,
NULL
);
$build
=
$this
->
viewBuil
der
->
view
(
$node
,
'print'
,
NULL
);
unset
(
$build
[
'#theme'
]);
// @todo Rendering should happen in the template using render().
...
...
core/modules/comment/comment.module
View file @
4b7bbecb
...
...
@@ -271,7 +271,7 @@ function comment_field_instance_create(FieldInstanceInterface $instance) {
*/
function
comment_field_instance_update
(
FieldInstanceInterface
$instance
)
{
if
(
$instance
->
getFieldType
()
==
'comment'
)
{
\
Drupal
::
entityManager
()
->
get
RenderControll
er
(
$instance
->
entity_type
)
->
resetCache
();
\
Drupal
::
entityManager
()
->
get
ViewBuild
er
(
$instance
->
entity_type
)
->
resetCache
();
}
}
...
...
@@ -1255,7 +1255,7 @@ function comment_get_display_ordinal($cid, $instance) {
else
{
// For threaded comments, the c.thread column is used for ordering. We can
// use the sorting code for comparison, but must remove the trailing slash.
// See Comment
RenderControll
er.
// See Comment
ViewBuild
er.
$query
->
where
(
'SUBSTRING(c1.thread, 1, (LENGTH(c1.thread) -1)) < SUBSTRING(c2.thread, 1, (LENGTH(c2.thread) -1))'
);
}
...
...
@@ -1372,7 +1372,7 @@ function comment_preprocess_block(&$variables) {
* A user account, for use with theme_username() or the user_picture template.
*/
function
comment_prepare_author
(
CommentInterface
$comment
)
{
// The account has been pre-loaded by Comment
RenderControll
er::buildContent().
// The account has been pre-loaded by Comment
ViewBuild
er::buildContent().
$account
=
$comment
->
uid
->
entity
;
if
(
empty
(
$account
->
uid
->
value
))
{
$account
=
entity_create
(
'user'
,
array
(
'uid'
=>
0
,
'name'
=>
$comment
->
name
->
value
,
'homepage'
=>
$comment
->
homepage
->
value
));
...
...
core/modules/comment/lib/Drupal/comment/CommentFormController.php
View file @
4b7bbecb
...
...
@@ -49,7 +49,7 @@ public static function create(ContainerInterface $container) {
}
/**
* Constructs a new Comment
Render
Controller.
* Constructs a new Comment
Form
Controller.
*
* @param \Drupal\Core\Entity\EntityManager $entity_manager
* The entity manager service.
...
...
@@ -410,6 +410,6 @@ public function save(array $form, array &$form_state) {
// Clear the block and page caches so that anonymous users see the comment
// they have posted.
Cache
::
invalidateTags
(
array
(
'content'
=>
TRUE
));
$this
->
entityManager
->
get
RenderControll
er
(
$entity
->
entityType
())
->
resetCache
(
array
(
$entity
->
id
()));
$this
->
entityManager
->
get
ViewBuild
er
(
$entity
->
entityType
())
->
resetCache
(
array
(
$entity
->
id
()));
}
}
core/modules/comment/lib/Drupal/comment/Comment
RenderControll
er.php
→
core/modules/comment/lib/Drupal/comment/Comment
ViewBuild
er.php
View file @
4b7bbecb
...
...
@@ -2,7 +2,7 @@
/**
* @file
* Definition of Drupal\comment\Comment
RenderControll
er.
* Definition of Drupal\comment\Comment
ViewBuild
er.
*/
namespace
Drupal\comment
;
...
...
@@ -11,8 +11,9 @@
use
Drupal\Core\Entity\EntityControllerInterface
;
use
Drupal\Core\Entity\EntityInterface
;
use
Drupal\Core\Entity\EntityManager
;
use
Drupal\Core\Entity\Entity
RenderController
;
use
Drupal\Core\Entity\Entity
ViewBuilderInterface
;
use
Drupal\Core\Extension\ModuleHandlerInterface
;
use
Drupal\Core\Entity\EntityViewBuilder
;
use
Drupal\entity\Entity\EntityDisplay
;
use
Drupal\field\FieldInfo
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
...
...
@@ -20,7 +21,7 @@
/**
* Render controller for comments.
*/
class
Comment
RenderController
extends
EntityRenderController
implements
EntityControllerInterface
{
class
Comment
ViewBuilder
extends
EntityViewBuilder
implements
EntityViewBuilderInterface
,
EntityControllerInterface
{
/**
* The entity manager service.
...
...
@@ -64,7 +65,7 @@ public static function createInstance(ContainerInterface $container, $entity_typ
}
/**
* Constructs a new Comment
RenderControll
er.
* Constructs a new Comment
ViewBuild
er.
*
* @param string $entity_type
* The entity type.
...
...
@@ -86,7 +87,7 @@ public function __construct($entity_type, EntityManager $entity_manager, FieldIn
}
/**
* Overrides Drupal\Core\Entity\Entity
RenderControll
er::buildContent().
* Overrides Drupal\Core\Entity\Entity
ViewBuild
er::buildContent().
*
* In addition to modifying the content key on entities, this implementation
* will also set the comment entity key which all comments carry.
...
...
@@ -225,7 +226,7 @@ protected function buildLinks(CommentInterface $entity, EntityInterface $comment
}