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
#!/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 | |
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. |
OlderNewer