This file contains 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 | |
declare(strict_types = 1); | |
namespace Drupal\some_module\Hooks; | |
use Drupal\Core\DependencyInjection\ContainerInjectionInterface; | |
use Drupal\entity_hierarchy\Storage\EntityTreeNodeMapperInterface; | |
use Drupal\entity_hierarchy\Storage\NestedSetNodeKeyFactory; | |
use Drupal\entity_hierarchy\Storage\NestedSetStorageFactory; |
This file contains 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 | |
namespace Drupal\my_module\EventSubscriber; | |
use Drupal\jsonapi\ResourceType\ResourceTypeBuildEvents; | |
use Drupal\jsonapi\ResourceType\ResourceTypeBuildEvent; | |
use Symfony\Component\EventDispatcher\EventSubscriberInterface; | |
/** | |
* Event subscriber to disable all resource types except what we need. |
This file contains 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 League\Csv\Writer; | |
$entityStorage = \Drupal::entityTypeManager()->getStorage('node'); | |
$entityTypeStorage = \Drupal::entityTypeManager()->getStorage('node_type'); | |
$db = \Drupal::database(); | |
$nids = $entityStorage->getQuery() | |
// Everything since Jan 1st 2020 | |
->condition('created', '1577836800', '>=') |
This file contains 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 | |
namespace Drupal\tfnsw_corp_asa_standard\Plugin\Field\FieldWidget; | |
use Drupal\Component\Utility\NestedArray; | |
use Drupal\Core\Field\FieldItemListInterface; | |
use Drupal\Core\Field\Plugin\Field\FieldWidget\EntityReferenceAutocompleteWidget; | |
use Drupal\Core\Form\FormStateInterface; | |
/** |
This file contains 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 | |
namespace Drupal\djr_views\Plugin\views\filter; | |
use Drupal\Core\Form\FormStateInterface; | |
use Drupal\taxonomy\Entity\Term; | |
use Drupal\taxonomy\Plugin\views\filter\TaxonomyIndexTid; | |
use Drupal\views\Plugin\views\filter\InOperator; | |
/** |