diff --git a/core/modules/entity_reference/entity_reference.module b/core/modules/entity_reference/entity_reference.module index 66de2c394519eb8eb2e75b9db053594cf3f8cbf5..5e438e68074d7282540475405a3547b6e450c621 100644 --- a/core/modules/entity_reference/entity_reference.module +++ b/core/modules/entity_reference/entity_reference.module @@ -115,7 +115,7 @@ function entity_reference_field_validate(EntityInterface $entity = NULL, $field, } if ($ids) { - $valid_ids = entity_reference_get_selection_handler($instance, $entity)->validateReferencableEntities(array_keys($ids)); + $valid_ids = entity_reference_get_selection_handler($instance, $entity)->validateReferenceableEntities(array_keys($ids)); $invalid_entities = array_diff_key($ids, array_flip($valid_ids)); if ($invalid_entities) { @@ -353,7 +353,7 @@ function entity_reference_settings_ajax_submit($form, &$form_state) { * Implements hook_options_list(). */ function entity_reference_options_list(FieldDefinitionInterface $field_definition, EntityInterface $entity) { - if (!$options = entity_reference_get_selection_handler($field_definition, $entity)->getReferencableEntities()) { + if (!$options = entity_reference_get_selection_handler($field_definition, $entity)->getReferenceableEntities()) { return array(); } diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/EntityReferenceAutocomplete.php b/core/modules/entity_reference/lib/Drupal/entity_reference/EntityReferenceAutocomplete.php index 6a42b574461d41936020d12534366922b3e1aaa4..f1e9178d37cd71e53caed05c89753bc417b7f21b 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/EntityReferenceAutocomplete.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/EntityReferenceAutocomplete.php @@ -77,7 +77,7 @@ public function getMatches($field, $instance, $entity_type, $entity_id = '', $pr // Get an array of matching entities. $widget = entity_get_form_display($instance['entity_type'], $instance['bundle'], 'default')->getComponent($instance['field_name']); $match_operator = !empty($widget['settings']['match_operator']) ? $widget['settings']['match_operator'] : 'CONTAINS'; - $entity_labels = $handler->getReferencableEntities($string, $match_operator, 10); + $entity_labels = $handler->getReferenceableEntities($string, $match_operator, 10); // Loop through the entities and convert them into autocomplete output. foreach ($entity_labels as $values) { diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Type/Selection/SelectionBroken.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Type/Selection/SelectionBroken.php index d8a73b97269c11a4a138426ac5158fc9bf78e453..0956657a134cc584f8c8c48ae7c0c96085e04460 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Type/Selection/SelectionBroken.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Type/Selection/SelectionBroken.php @@ -25,23 +25,23 @@ public static function settingsForm(&$field, &$instance) { } /** - * Implements SelectionInterface::getReferencableEntities(). + * Implements SelectionInterface::getReferenceableEntities(). */ - public function getReferencableEntities($match = NULL, $match_operator = 'CONTAINS', $limit = 0) { + public function getReferenceableEntities($match = NULL, $match_operator = 'CONTAINS', $limit = 0) { return array(); } /** - * Implements SelectionInterface::countReferencableEntities(). + * Implements SelectionInterface::countReferenceableEntities(). */ - public function countReferencableEntities($match = NULL, $match_operator = 'CONTAINS') { + public function countReferenceableEntities($match = NULL, $match_operator = 'CONTAINS') { return 0; } /** - * Implements SelectionInterface::validateReferencableEntities(). + * Implements SelectionInterface::validateReferenceableEntities(). */ - public function validateReferencableEntities(array $ids) { + public function validateReferenceableEntities(array $ids) { return array(); } diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Type/Selection/SelectionInterface.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Type/Selection/SelectionInterface.php index 069a2cbaa0514b61ff728c5b6bc092c369dd7f5c..43794544ad1dafb838aca4d99f99a0c05e96df80 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Type/Selection/SelectionInterface.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Type/Selection/SelectionInterface.php @@ -20,21 +20,21 @@ interface SelectionInterface { /** - * Returns a list of referencable entities. + * Returns a list of referenceable entities. * * @return array - * An array of referencable entities. Keys are entity IDs and + * An array of referenceable entities. Keys are entity IDs and * values are (safe HTML) labels to be displayed to the user. */ - public function getReferencableEntities($match = NULL, $match_operator = 'CONTAINS', $limit = 0); + public function getReferenceableEntities($match = NULL, $match_operator = 'CONTAINS', $limit = 0); /** - * Counts entities that are referencable by a given field. + * Counts entities that are referenceable by a given field. * * @return int - * The number of referencable entities. + * The number of referenceable entities. */ - public function countReferencableEntities($match = NULL, $match_operator = 'CONTAINS'); + public function countReferenceableEntities($match = NULL, $match_operator = 'CONTAINS'); /** * Validates that entities can be referenced by this field. @@ -42,7 +42,7 @@ public function countReferencableEntities($match = NULL, $match_operator = 'CONT * @return array * An array of valid entity IDs. */ - public function validateReferencableEntities(array $ids); + public function validateReferenceableEntities(array $ids); /** * Validates input from an autocomplete widget that has no ID. diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/entity_reference/selection/SelectionBase.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/entity_reference/selection/SelectionBase.php index c7942300c3410e3ba546f63ad32adede0fa96e71..94faf2271cc353de3a6ccf355a9fb0508241f5ba 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/entity_reference/selection/SelectionBase.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/entity_reference/selection/SelectionBase.php @@ -155,9 +155,9 @@ public static function settingsForm(&$field, &$instance) { } /** - * Implements SelectionInterface::getReferencableEntities(). + * Implements SelectionInterface::getReferenceableEntities(). */ - public function getReferencableEntities($match = NULL, $match_operator = 'CONTAINS', $limit = 0) { + public function getReferenceableEntities($match = NULL, $match_operator = 'CONTAINS', $limit = 0) { $target_type = $this->fieldDefinition->getFieldSetting('target_type'); $query = $this->buildEntityQuery($match, $match_operator); @@ -182,9 +182,9 @@ public function getReferencableEntities($match = NULL, $match_operator = 'CONTAI } /** - * Implements SelectionInterface::countReferencableEntities(). + * Implements SelectionInterface::countReferenceableEntities(). */ - public function countReferencableEntities($match = NULL, $match_operator = 'CONTAINS') { + public function countReferenceableEntities($match = NULL, $match_operator = 'CONTAINS') { $query = $this->buildEntityQuery($match, $match_operator); return $query ->count() @@ -192,9 +192,9 @@ public function countReferencableEntities($match = NULL, $match_operator = 'CONT } /** - * Implements SelectionInterface::validateReferencableEntities(). + * Implements SelectionInterface::validateReferenceableEntities(). */ - public function validateReferencableEntities(array $ids) { + public function validateReferenceableEntities(array $ids) { $result = array(); if ($ids) { $target_type = $this->fieldDefinition->getFieldSetting('target_type'); @@ -212,7 +212,7 @@ public function validateReferencableEntities(array $ids) { * Implements SelectionInterface::validateAutocompleteInput(). */ public function validateAutocompleteInput($input, &$element, &$form_state, $form, $strict = TRUE) { - $entities = $this->getReferencableEntities($input, '=', 6); + $entities = $this->getReferenceableEntities($input, '=', 6); $params = array( '%value' => $input, '@value' => $input, @@ -244,7 +244,7 @@ public function validateAutocompleteInput($input, &$element, &$form_state, $form } /** - * Builds an EntityQuery to get referencable entities. + * Builds an EntityQuery to get referenceable entities. * * @param string|null $match * (Optional) Text to match the label against. Defaults to NULL. diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceSelectionAccessTest.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceSelectionAccessTest.php index 8106bb9cc247f25dc2f8b873d24e4328caf4c363..9a611d4bd5334fbdd8547398403f041b0a8c7c0b 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceSelectionAccessTest.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceSelectionAccessTest.php @@ -33,15 +33,15 @@ function setUp() { $this->drupalCreateContentType(array('type' => 'article', 'name' => 'Article')); } - protected function assertReferencable(FieldDefinitionInterface $field_definition, $tests, $handler_name) { + protected function assertReferenceable(FieldDefinitionInterface $field_definition, $tests, $handler_name) { $handler = entity_reference_get_selection_handler($field_definition); foreach ($tests as $test) { foreach ($test['arguments'] as $arguments) { - $result = call_user_func_array(array($handler, 'getReferencableEntities'), $arguments); + $result = call_user_func_array(array($handler, 'getReferenceableEntities'), $arguments); $this->assertEqual($result, $test['result'], format_string('Valid result set returned by @handler.', array('@handler' => $handler_name))); - $result = call_user_func_array(array($handler, 'countReferencableEntities'), $arguments); + $result = call_user_func_array(array($handler, 'countReferenceableEntities'), $arguments); if (!empty($test['result'])) { $bundle = key($test['result']); $count = count($test['result'][$bundle]); @@ -119,7 +119,7 @@ public function testNodeHandler() { // Test as a non-admin. $normal_user = $this->drupalCreateUser(array('access content')); $GLOBALS['user'] = $normal_user; - $referencable_tests = array( + $referenceable_tests = array( array( 'arguments' => array( array(NULL, 'CONTAINS'), @@ -166,12 +166,12 @@ public function testNodeHandler() { 'result' => array(), ), ); - $this->assertReferencable($instance, $referencable_tests, 'Node handler'); + $this->assertReferenceable($instance, $referenceable_tests, 'Node handler'); // Test as an admin. $admin_user = $this->drupalCreateUser(array('access content', 'bypass node access')); $GLOBALS['user'] = $admin_user; - $referencable_tests = array( + $referenceable_tests = array( array( 'arguments' => array( array(NULL, 'CONTAINS'), @@ -195,7 +195,7 @@ public function testNodeHandler() { ), ), ); - $this->assertReferencable($instance, $referencable_tests, 'Node handler (admin)'); + $this->assertReferenceable($instance, $referenceable_tests, 'Node handler (admin)'); } /** @@ -265,7 +265,7 @@ public function testUserHandler() { // Test as a non-admin. $GLOBALS['user'] = $users['non_admin']; - $referencable_tests = array( + $referenceable_tests = array( array( 'arguments' => array( array(NULL, 'CONTAINS'), @@ -301,10 +301,10 @@ public function testUserHandler() { 'result' => array(), ), ); - $this->assertReferencable($instance, $referencable_tests, 'User handler'); + $this->assertReferenceable($instance, $referenceable_tests, 'User handler'); $GLOBALS['user'] = $users['admin']; - $referencable_tests = array( + $referenceable_tests = array( array( 'arguments' => array( array(NULL, 'CONTAINS'), @@ -340,7 +340,7 @@ public function testUserHandler() { ), ), ); - $this->assertReferencable($instance, $referencable_tests, 'User handler (admin)'); + $this->assertReferenceable($instance, $referenceable_tests, 'User handler (admin)'); } /** @@ -436,7 +436,7 @@ public function testCommentHandler() { // Test as a non-admin. $normal_user = $this->drupalCreateUser(array('access content', 'access comments')); $GLOBALS['user'] = $normal_user; - $referencable_tests = array( + $referenceable_tests = array( array( 'arguments' => array( array(NULL, 'CONTAINS'), @@ -470,12 +470,12 @@ public function testCommentHandler() { 'result' => array(), ), ); - $this->assertReferencable($instance, $referencable_tests, 'Comment handler'); + $this->assertReferenceable($instance, $referenceable_tests, 'Comment handler'); // Test as a comment admin. $admin_user = $this->drupalCreateUser(array('access content', 'access comments', 'administer comments')); $GLOBALS['user'] = $admin_user; - $referencable_tests = array( + $referenceable_tests = array( array( 'arguments' => array( array(NULL, 'CONTAINS'), @@ -488,12 +488,12 @@ public function testCommentHandler() { ), ), ); - $this->assertReferencable($instance, $referencable_tests, 'Comment handler (comment admin)'); + $this->assertReferenceable($instance, $referenceable_tests, 'Comment handler (comment admin)'); // Test as a node and comment admin. $admin_user = $this->drupalCreateUser(array('access content', 'access comments', 'administer comments', 'bypass node access')); $GLOBALS['user'] = $admin_user; - $referencable_tests = array( + $referenceable_tests = array( array( 'arguments' => array( array(NULL, 'CONTAINS'), @@ -507,6 +507,6 @@ public function testCommentHandler() { ), ), ); - $this->assertReferencable($instance, $referencable_tests, 'Comment handler (comment + node admin)'); + $this->assertReferenceable($instance, $referenceable_tests, 'Comment handler (comment + node admin)'); } } diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceSelectionSortTest.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceSelectionSortTest.php index 09dd2c877c8617ee2c59bf8573d371e9d9fecf22..f7b8fbc2dc144548afdf135a34984c05fdf8b004 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceSelectionSortTest.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceSelectionSortTest.php @@ -125,7 +125,7 @@ public function testSort() { // Not only assert the result, but make sure the keys are sorted as // expected. - $result = $handler->getReferencableEntities(); + $result = $handler->getReferenceableEntities(); $expected_result = array( $nodes['published2']->nid => $node_labels['published2'], $nodes['published1']->nid => $node_labels['published1'], @@ -138,7 +138,7 @@ public function testSort() { 'direction' => 'ASC', ); $handler = entity_reference_get_selection_handler($instance); - $result = $handler->getReferencableEntities(); + $result = $handler->getReferenceableEntities(); $expected_result = array( $nodes['published1']->nid => $node_labels['published1'], $nodes['published2']->nid => $node_labels['published2'], diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/Views/SelectionTest.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/Views/SelectionTest.php index 0bfdae39d9e1827e25d4eb20634f6d7100c1ca36..81276824d22c2a6a85793652a0232eb7f80bbbbd 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/Views/SelectionTest.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/Views/SelectionTest.php @@ -71,7 +71,7 @@ public function testSelectionHandler() { // Get values from selection handler. $handler = entity_reference_get_selection_handler($instance); - $result = $handler->getReferencableEntities(); + $result = $handler->getReferenceableEntities(); $success = FALSE; foreach ($result as $node_type => $values) { diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/entity_reference/selection/TermSelection.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/entity_reference/selection/TermSelection.php index e49f31e50f3c90c66afce6b6e9ecbe259fe0ddaf..35b04a01f1d33c9a1800d042c842342c7f6fe267 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/entity_reference/selection/TermSelection.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/entity_reference/selection/TermSelection.php @@ -51,11 +51,11 @@ public static function settingsForm(&$field, &$instance) { /** - * Overrides SelectionBase::getReferencableEntities(). + * Overrides SelectionBase::getReferenceableEntities(). */ - public function getReferencableEntities($match = NULL, $match_operator = 'CONTAINS', $limit = 0) { + public function getReferenceableEntities($match = NULL, $match_operator = 'CONTAINS', $limit = 0) { if ($match || $limit) { - return parent::getReferencableEntities($match , $match_operator, $limit); + return parent::getReferenceableEntities($match , $match_operator, $limit); } $options = array(); diff --git a/core/modules/views/lib/Drupal/views/Plugin/entity_reference/selection/ViewsSelection.php b/core/modules/views/lib/Drupal/views/Plugin/entity_reference/selection/ViewsSelection.php index 575c0007693619ed563511155d5621d40111453d..c5df6d7a0bd8402578a253d2c36f394bd2b8332e 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/entity_reference/selection/ViewsSelection.php +++ b/core/modules/views/lib/Drupal/views/Plugin/entity_reference/selection/ViewsSelection.php @@ -155,9 +155,9 @@ protected function initializeView($match = NULL, $match_operator = 'CONTAINS', $ } /** - * Implements \Drupal\entity_reference\Plugin\Type\Selection\SelectionInterface::getReferencableEntities(). + * Implements \Drupal\entity_reference\Plugin\Type\Selection\SelectionInterface::getReferenceableEntities(). */ - public function getReferencableEntities($match = NULL, $match_operator = 'CONTAINS', $limit = 0) { + public function getReferenceableEntities($match = NULL, $match_operator = 'CONTAINS', $limit = 0) { $handler_settings = $this->fieldDefinition->getFieldSetting('handler_settings'); $display_name = $handler_settings['view']['display_name']; $arguments = $handler_settings['view']['arguments']; @@ -178,17 +178,17 @@ public function getReferencableEntities($match = NULL, $match_operator = 'CONTAI } /** - * Implements \Drupal\entity_reference\Plugin\Type\Selection\SelectionInterface::countReferencableEntities(). + * Implements \Drupal\entity_reference\Plugin\Type\Selection\SelectionInterface::countReferenceableEntities(). */ - public function countReferencableEntities($match = NULL, $match_operator = 'CONTAINS') { - $this->getReferencableEntities($match, $match_operator); + public function countReferenceableEntities($match = NULL, $match_operator = 'CONTAINS') { + $this->getReferenceableEntities($match, $match_operator); return $this->view->pager->getTotalItems(); } /** - * Implements \Drupal\entity_reference\Plugin\Type\Selection\SelectionInterface::validateReferencableEntities(). + * Implements \Drupal\entity_reference\Plugin\Type\Selection\SelectionInterface::validateReferenceableEntities(). */ - public function validateReferencableEntities(array $ids) { + public function validateReferenceableEntities(array $ids) { $handler_settings = $this->fieldDefinition->getFieldSetting('handler_settings'); $display_name = $handler_settings['view']['display_name']; $arguments = $handler_settings['view']['arguments'];