Replace tightenco/collect with illuminate/collections

Fixes #417
This commit is contained in:
Oliver Davies 2021-04-23 08:58:14 +01:00
parent 7f39c01d87
commit e9c2f2a2b0
12 changed files with 212 additions and 67 deletions

View file

@ -6,7 +6,7 @@ namespace Drupal\opdavies_talks\Collection;
use Drupal\opdavies_talks\Entity\Node\Talk;
use Drupal\paragraphs\ParagraphInterface;
use Tightenco\Collect\Support\Collection;
use Illuminate\Support\Collection;
final class TalkCollection extends Collection {

View file

@ -5,7 +5,7 @@ namespace Drupal\opdavies_talks\Entity\Node;
use Drupal\discoverable_entity_bundle_classes\ContentEntityBundleInterface;
use Drupal\node\Entity\Node;
use Drupal\paragraphs\ParagraphInterface;
use Tightenco\Collect\Support\Collection;
use Illuminate\Support\Collection;
/**
* Defines an talk node class.

View file

@ -10,7 +10,7 @@ use Drupal\hook_event_dispatcher\HookEventDispatcherInterface;
use Drupal\opdavies_talks\Entity\Node\Talk;
use Drupal\paragraphs\ParagraphInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Tightenco\Collect\Support\Collection;
use Illuminate\Support\Collection;
/**
* Update a talk node before it's saved.
@ -44,6 +44,7 @@ final class UpdateTalkNodeBeforeSave implements EventSubscriberInterface {
// If the original event IDs don't match the sorted event IDs, update the
// event field to use the sorted ones.
// @phpstan-ignore-next-line
if ($events->map->id() != $eventsByDate->map->id()) {
$talk->setEvents($eventsByDate->toArray());
}