summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2013-06-13 09:22:22 +0100
committerAlex Pott2013-06-13 09:22:22 +0100
commit2b51e787474ba390a9a525043b778141d8e33b82 (patch)
treefe96deaea1be4dbfcedbf6af65db6cec8ea58da1
parent342f132b35a36318930152514b0b78b90a677136 (diff)
Issue #2002906 by pwieck, jibran, aaronott, chr.fritsch, chrisguindon: Rename Views method get_entity() to getEntity().
-rw-r--r--core/modules/comment/lib/Drupal/comment/Plugin/views/field/Link.php2
-rw-r--r--core/modules/comment/lib/Drupal/comment/Plugin/views/field/NodeLink.php2
-rw-r--r--core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php2
-rw-r--r--core/modules/node/lib/Drupal/node/Plugin/views/field/Link.php2
-rw-r--r--core/modules/node/lib/Drupal/node/Plugin/views/field/RevisionLink.php2
-rw-r--r--core/modules/system/lib/Drupal/system/Plugin/views/field/BulkFormBase.php2
-rw-r--r--core/modules/translation_entity/lib/Drupal/translation_entity/Plugin/views/field/TranslationLink.php2
-rw-r--r--core/modules/user/lib/Drupal/user/Plugin/views/field/Link.php2
-rw-r--r--core/modules/user/lib/Drupal/user/Plugin/views/field/User.php2
-rw-r--r--core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php2
-rw-r--r--core/modules/views/lib/Drupal/views/Tests/Entity/FieldEntityTest.php8
11 files changed, 14 insertions, 14 deletions
diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/views/field/Link.php b/core/modules/comment/lib/Drupal/comment/Plugin/views/field/Link.php
index d9cd672..d1e19f5 100644
--- a/core/modules/comment/lib/Drupal/comment/Plugin/views/field/Link.php
+++ b/core/modules/comment/lib/Drupal/comment/Plugin/views/field/Link.php
@@ -43,7 +43,7 @@ class Link extends FieldPluginBase {
public function query() {}
function render($values) {
- $comment = $this->get_entity($values);
+ $comment = $this->getEntity($values);
return $this->render_link($comment, $values);
}
diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/views/field/NodeLink.php b/core/modules/comment/lib/Drupal/comment/Plugin/views/field/NodeLink.php
index fdfe8d9..cdb3786 100644
--- a/core/modules/comment/lib/Drupal/comment/Plugin/views/field/NodeLink.php
+++ b/core/modules/comment/lib/Drupal/comment/Plugin/views/field/NodeLink.php
@@ -39,7 +39,7 @@ class NodeLink extends FieldPluginBase {
public function query() {}
function render($values) {
- $node = $this->get_entity($values);
+ $node = $this->getEntity($values);
comment_node_view($node, $this->options['teaser'] ? 'teaser' : 'full');
// Only render the links if they are defined.
diff --git a/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php b/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php
index 77927e7..e69e2f7 100644
--- a/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php
+++ b/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php
@@ -644,7 +644,7 @@ class Field extends FieldPluginBase {
* Return an array of items for the field.
*/
public function getItems($values) {
- $original_entity = $this->get_entity($values);
+ $original_entity = $this->getEntity($values);
if (!$original_entity) {
return array();
}
diff --git a/core/modules/node/lib/Drupal/node/Plugin/views/field/Link.php b/core/modules/node/lib/Drupal/node/Plugin/views/field/Link.php
index f01a62f..8327bcf 100644
--- a/core/modules/node/lib/Drupal/node/Plugin/views/field/Link.php
+++ b/core/modules/node/lib/Drupal/node/Plugin/views/field/Link.php
@@ -46,7 +46,7 @@ class Link extends FieldPluginBase {
}
function render($values) {
- if ($entity = $this->get_entity($values)) {
+ if ($entity = $this->getEntity($values)) {
return $this->render_link($entity, $values);
}
}
diff --git a/core/modules/node/lib/Drupal/node/Plugin/views/field/RevisionLink.php b/core/modules/node/lib/Drupal/node/Plugin/views/field/RevisionLink.php
index 066742b..5df4452 100644
--- a/core/modules/node/lib/Drupal/node/Plugin/views/field/RevisionLink.php
+++ b/core/modules/node/lib/Drupal/node/Plugin/views/field/RevisionLink.php
@@ -67,7 +67,7 @@ class RevisionLink extends Link {
*/
function get_revision_entity($values, $op) {
$vid = $this->getValue($values, 'node_vid');
- $node = $this->get_entity($values);
+ $node = $this->getEntity($values);
// Unpublished nodes ignore access control.
$node->status = 1;
// Ensure user has access to perform the operation on this node.
diff --git a/core/modules/system/lib/Drupal/system/Plugin/views/field/BulkFormBase.php b/core/modules/system/lib/Drupal/system/Plugin/views/field/BulkFormBase.php
index 4bc26dd..e61c399 100644
--- a/core/modules/system/lib/Drupal/system/Plugin/views/field/BulkFormBase.php
+++ b/core/modules/system/lib/Drupal/system/Plugin/views/field/BulkFormBase.php
@@ -143,7 +143,7 @@ abstract class BulkFormBase extends FieldPluginBase {
$selected = array_filter($form_state['values'][$this->options['id']]);
$entities = array();
foreach (array_intersect_key($this->view->result, $selected) as $row) {
- $entity = $this->get_entity($row);
+ $entity = $this->getEntity($row);
$entities[$entity->id()] = $entity;
}
diff --git a/core/modules/translation_entity/lib/Drupal/translation_entity/Plugin/views/field/TranslationLink.php b/core/modules/translation_entity/lib/Drupal/translation_entity/Plugin/views/field/TranslationLink.php
index 618b6ae..84f3d78 100644
--- a/core/modules/translation_entity/lib/Drupal/translation_entity/Plugin/views/field/TranslationLink.php
+++ b/core/modules/translation_entity/lib/Drupal/translation_entity/Plugin/views/field/TranslationLink.php
@@ -45,7 +45,7 @@ class TranslationLink extends FieldPluginBase {
* Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::render().
*/
function render($values) {
- return $this->render_link($this->get_entity($values), $values);
+ return $this->render_link($this->getEntity($values), $values);
}
/**
diff --git a/core/modules/user/lib/Drupal/user/Plugin/views/field/Link.php b/core/modules/user/lib/Drupal/user/Plugin/views/field/Link.php
index 20f68e8..6e143b7 100644
--- a/core/modules/user/lib/Drupal/user/Plugin/views/field/Link.php
+++ b/core/modules/user/lib/Drupal/user/Plugin/views/field/Link.php
@@ -60,7 +60,7 @@ class Link extends FieldPluginBase {
* Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::render().
*/
function render($values) {
- return $this->render_link($this->get_entity($values), $values);
+ return $this->render_link($this->getEntity($values), $values);
}
/**
diff --git a/core/modules/user/lib/Drupal/user/Plugin/views/field/User.php b/core/modules/user/lib/Drupal/user/Plugin/views/field/User.php
index b94bdbe..13edb18 100644
--- a/core/modules/user/lib/Drupal/user/Plugin/views/field/User.php
+++ b/core/modules/user/lib/Drupal/user/Plugin/views/field/User.php
@@ -52,7 +52,7 @@ class User extends FieldPluginBase {
}
function render_link($data, $values) {
- if (!empty($this->options['link_to_user']) && user_access('access user profiles') && ($entity = $this->get_entity($values)) && $data !== NULL && $data !== '') {
+ if (!empty($this->options['link_to_user']) && user_access('access user profiles') && ($entity = $this->getEntity($values)) && $data !== NULL && $data !== '') {
$this->options['alter']['make_link'] = TRUE;
$uri = $entity->uri();
$this->options['alter']['path'] = $uri['path'];
diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php
index 6655d6a..fa26d7d 100644
--- a/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php
+++ b/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php
@@ -367,7 +367,7 @@ abstract class FieldPluginBase extends HandlerBase {
* @return \Drupal\Core\Entity\EntityInterface
* Returns the entity matching the values.
*/
- public function get_entity(\stdClass $values) {
+ public function getEntity(\stdClass $values) {
$relationship_id = $this->options['relationship'];
if ($relationship_id == 'none') {
return $values->_entity;
diff --git a/core/modules/views/lib/Drupal/views/Tests/Entity/FieldEntityTest.php b/core/modules/views/lib/Drupal/views/Tests/Entity/FieldEntityTest.php
index 87b4fbd..0950180 100644
--- a/core/modules/views/lib/Drupal/views/Tests/Entity/FieldEntityTest.php
+++ b/core/modules/views/lib/Drupal/views/Tests/Entity/FieldEntityTest.php
@@ -37,7 +37,7 @@ class FieldEntityTest extends ViewTestBase {
}
/**
- * Tests the get_entity method.
+ * Tests the getEntity method.
*/
public function testGetEntity() {
// The view is a view of comments, their nodes and their authors, so there
@@ -55,13 +55,13 @@ class FieldEntityTest extends ViewTestBase {
$row = $view->result[0];
// Tests entities on the base level.
- $entity = $view->field['cid']->get_entity($row);
+ $entity = $view->field['cid']->getEntity($row);
$this->assertEqual($entity->id(), $comment->id(), 'Make sure the right comment entity got loaded.');
// Tests entities as relationship on first level.
- $entity = $view->field['nid']->get_entity($row);
+ $entity = $view->field['nid']->getEntity($row);
$this->assertEqual($entity->id(), $node->id(), 'Make sure the right node entity got loaded.');
// Tests entities as relationships on second level.
- $entity = $view->field['uid']->get_entity($row);
+ $entity = $view->field['uid']->getEntity($row);
$this->assertEqual($entity->id(), $account->id(), 'Make sure the right user entity got loaded.');
}