namespace Drupal\metatag\Entity;
use Drupal\Core\Config\Entity\ConfigEntityBase;
+use Drupal\Core\Config\Entity\ConfigEntityInterface;
use Drupal\Core\Config\FileStorage;
use Drupal\Core\Config\InstallStorage;
use Drupal\Core\Config\StorageInterface;
}
}
+ /**
+ * {@inheritdoc}
+ */
+ public static function sort(ConfigEntityInterface $a, ConfigEntityInterface $b) {
+ // Put always Global in 1st place and front page later if available.
+ if ($a->id() == 'global') {
+ return -1;
+ }
+ elseif ($b->id() == 'global') {
+ return 1;
+ }
+ elseif ($a->id() == 'front') {
+ return -1;
+ }
+ elseif ($b->id() == 'front') {
+ return 1;
+ }
+
+ // Use the default sort function.
+ return parent::sort($a, $b);
+ }
+
}