Wire admin studio SSR and search infrastructure
This commit is contained in:
@@ -35,10 +35,7 @@ abstract class AbstractIdShardableSitemapBuilder extends AbstractSitemapBuilder
|
||||
|
||||
public function lastModified(): ?DateTimeInterface
|
||||
{
|
||||
return $this->newest(...array_map(
|
||||
fn (SitemapUrl $item): ?DateTimeInterface => $item->lastModified,
|
||||
$this->items(),
|
||||
));
|
||||
return $this->dateTime((clone $this->query())->max($this->lastModifiedColumn()));
|
||||
}
|
||||
|
||||
public function totalItems(): int
|
||||
@@ -69,10 +66,16 @@ abstract class AbstractIdShardableSitemapBuilder extends AbstractSitemapBuilder
|
||||
|
||||
public function lastModifiedForShard(int $shard): ?DateTimeInterface
|
||||
{
|
||||
return $this->newest(...array_map(
|
||||
fn (SitemapUrl $item): ?DateTimeInterface => $item->lastModified,
|
||||
$this->itemsForShard($shard),
|
||||
));
|
||||
$window = $this->shardWindow($shard);
|
||||
|
||||
if ($window === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $this->dateTime(
|
||||
$this->applyShardWindow($window['from'], $window['to'])
|
||||
->max($this->lastModifiedColumn()),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -132,4 +135,9 @@ abstract class AbstractIdShardableSitemapBuilder extends AbstractSitemapBuilder
|
||||
{
|
||||
return $this->idColumn();
|
||||
}
|
||||
|
||||
protected function lastModifiedColumn(): string
|
||||
{
|
||||
return 'updated_at';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user