This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$fields = $entity->getFields(); | |
$entity_values = []; | |
/** @var \Drupal\Core\Field\FieldItemList $field */ | |
foreach ($fields as $field_id => $field) { | |
$entity_values[$field_id] = $field->getValue(); | |
if (method_exists($field, 'referencedEntities')) { | |
$referenced_entities = $field->referencedEntities(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements hook_form_alter(). | |
* | |
* @param $form | |
* @param \Drupal\Core\Form\FormStateInterface $form_state | |
* @param $form_id | |
*/ | |
function MY_THEME_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @file | |
* Contains \Drupal\my_module\Plugin\views\query\CustomSql. | |
*/ | |
namespace Drupal\my_module\Plugin\views\query; | |
use Drupal\views\Plugin\views\query\Sql; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Implements hook_library_info_build(). | |
* | |
* @return array | |
*/ | |
function hook_library_info_build() { | |
$libraries = []; | |
/** @var \Drupal\Core\Language\LanguageManager $language_manager */ | |
$language_manager = \Drupal::languageManager(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Special terms | |
type: module | |
description: Provides views display switching for special terms | |
core: 8.x | |
version: 8.x-0.1.0 | |
package: Taxonomy | |
dependencies: | |
- views | |
- taxonomy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Drupal\Core\Render\BubbleableMetadata; | |
/** | |
* @implements hook_token_info(). | |
*/ | |
function my_module_token_info() { | |
$type = [ | |
'name' => t('Custom tokens'), |