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 Drupal\media\Entity\Media; | |
// Get the ids of all media entities. | |
$media_ids = \Drupal::entityQuery('media') | |
->accessCheck(FALSE) | |
->execute(); | |
// Load and process each media entity. |
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
#!/bin/sh | |
# Exit the script if any statement returns a non-true return value. | |
set -e | |
# Goto the project root using Drush | |
root="$(drush dd)" | |
cd "$root" | |
cd .. |
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\my_module; | |
use Drupal\Core\Entity\ContentEntityInterface; | |
use Drupal\Core\Path\CurrentPathStack; | |
use Drupal\Core\Session\AccountProxyInterface; | |
use Drupal\Core\StringTranslation\StringTranslationTrait; | |
use Twig\Extension\AbstractExtension; | |
use Twig\TwigFunction; |
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\my_module\Form; | |
use Drupal\Core\Form\ConfigFormBase; | |
use Drupal\Core\Form\FormStateInterface; | |
use Drupal\Core\Form\RedundantEditableConfigNamesTrait; | |
/** | |
* Configure mymodule settings for this site. |
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\frs_blocks\Plugin\Context; | |
use Drupal\Core\Cache\CacheableMetadata; | |
use Drupal\Core\Plugin\Context\Context; | |
use Drupal\Core\Plugin\Context\ContextProviderInterface; | |
use Drupal\Core\Plugin\Context\EntityContext; | |
use Drupal\Core\Plugin\Context\EntityContextDefinition; | |
use Drupal\Core\Routing\RouteMatchInterface; |
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\frs_entities\Entity\Bundle; | |
use Drupal\Core\Field\FieldItemList; | |
/** | |
* A bundle class for node entities. | |
* | |
* @property FieldItemList $field_content |
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 | |
/** | |
* Scans for discontinued series titles, sets the discontinued flag and | |
* rebuilds the title using the last broadcast episode. | |
*/ | |
// Get all series entities. | |
$series = \Drupal::entityTypeManager() | |
->getStorage('node') |
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
script: | |
js: | |
js/script.js: {} | |
dependencies: | |
- core/drupal | |
- core/jquery | |
- core/once |
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\behaviors\Plugin\paragraphs\Behavior; | |
use Drupal\Core\Entity\Display\EntityViewDisplayInterface; | |
use Drupal\Core\Form\FormStateInterface; | |
use Drupal\paragraphs\Entity\Paragraph; | |
use Drupal\paragraphs\ParagraphInterface; | |
use Drupal\paragraphs\ParagraphsBehaviorBase; |
NewerOlder