You are here

public function ContentBlockManager::getSelector in Open Social 8.9

Same name and namespace in other branches
  1. 8.8 modules/social_features/social_content_block/src/ContentBlockManager.php \Drupal\social_content_block\ContentBlockManager::getSelector()
  2. 10.3.x modules/social_features/social_content_block/src/ContentBlockManager.php \Drupal\social_content_block\ContentBlockManager::getSelector()
  3. 10.0.x modules/social_features/social_content_block/src/ContentBlockManager.php \Drupal\social_content_block\ContentBlockManager::getSelector()
  4. 10.1.x modules/social_features/social_content_block/src/ContentBlockManager.php \Drupal\social_content_block\ContentBlockManager::getSelector()
  5. 10.2.x modules/social_features/social_content_block/src/ContentBlockManager.php \Drupal\social_content_block\ContentBlockManager::getSelector()

Build the States API selector.

Parameters

string $field_name: The field name.

string $column: The field column name.

array|null $field_parents: (optional) The field parents.

Return value

string The selector.

Overrides ContentBlockManagerInterface::getSelector

File

modules/social_features/social_content_block/src/ContentBlockManager.php, line 46

Class

ContentBlockManager
Class ContentBlockManager.

Namespace

Drupal\social_content_block

Code

public function getSelector($field_name, $column, $field_parents = NULL) {
  if ($field_parents !== NULL) {
    $this->fieldParents = $field_parents;
  }
  $parents = array_merge($this->fieldParents, [
    $field_name,
    0,
    $column,
  ]);
  $parent = array_shift($parents);
  return ':input[name="' . $parent . '[' . implode('][', $parents) . ']"]';
}