Skip to content

Commit

Permalink
API Remove deprecated API
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli committed Jan 6, 2025
1 parent 7d18c0f commit 80b1ecd
Showing 1 changed file with 0 additions and 89 deletions.
89 changes: 0 additions & 89 deletions src/Extension/Engine/SiteTreePublishingEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use SilverStripe\Core\Extension;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\Core\Resettable;
use SilverStripe\Dev\Deprecation;
use SilverStripe\ORM\DataObject;
use SilverStripe\StaticPublishQueue\Contract\StaticPublishingTrigger;
use SilverStripe\StaticPublishQueue\Extension\Publishable\PublishableSiteTree;
Expand Down Expand Up @@ -51,88 +50,6 @@ class SiteTreePublishingEngine extends Extension implements Resettable
*/
private array $urlsToDelete = [];

/**
* Queues the urls to be flushed into the queue.
*
* @var array
* @deprecated 6.0.0 Use $urlsToDelete instead
*/
private $toUpdate = [];

/**
* Queues the urls to be deleted as part of a next flush operation.
*
* @var array
* @deprecated 6.0.0 Use $urlsToDelete instead
*/
private $toDelete = [];

/**
* @return array
* @deprecated 6.0.0 Use getUrlsToUpdate() instead
*/
public function getToUpdate()
{
Deprecation::notice('6.0.0', 'Use getUrlsToUpdate() instead');

return $this->toUpdate;
}

/**
* @return array
* @deprecated 6.0.0 Use getUrlsToDelete() instead
*/
public function getToDelete()
{
Deprecation::notice('6.0.0', 'Use getUrlsToDelete() instead');

return $this->toDelete;
}

/**
* @param array $toUpdate
* @return $this
* @deprecated 6.0.0 Use setUrlsToUpdate() instead
*/
public function setToUpdate($toUpdate)
{
Deprecation::notice('6.0.0', 'Use setUrlsToUpdate() instead');

$urlsToUpdate = [];

foreach ($toUpdate as $objectToUpdate) {
$urlsToUpdate = array_merge($urlsToUpdate, array_keys($objectToUpdate->urlsToCache()));
}

$this->setUrlsToUpdate($urlsToUpdate);
// Legacy support so that getToUpdate() still returns the expected array of DataObjects
$this->toUpdate = $toUpdate;

return $this;
}

/**
* @param array $toDelete
* @return $this
* @deprecated 6.0.0 Use setUrlsToDelete() instead
*/
public function setToDelete($toDelete)
{
Deprecation::notice('6.0.0', 'Use setUrlsToUpdate() instead');

$urlsToDelete = [];

foreach ($toDelete as $objectToDelete) {
$urlsToDelete = array_merge($urlsToDelete, array_keys($objectToDelete->urlsToCache()));
}

$this->setUrlsToDelete($urlsToDelete);
// Legacy support so that getToDelete() still returns the expected array of DataObjects
$this->toDelete = $toDelete;

return $this;
}

public static function reset(): void
{
static::$queueService = null;
Expand Down Expand Up @@ -282,12 +199,6 @@ public function collectChanges($context)
if (!$siteTree->hasExtension(PublishableSiteTree::class) && !($siteTree instanceof StaticPublishingTrigger)) {
return;
}

// Fetch our objects to be actioned
Deprecation::withSuppressedNotice(function () use ($siteTree, $context): void {
$this->setToUpdate($siteTree->objectsToUpdate($context));
$this->setToDelete($siteTree->objectsToDelete($context));
});
});
}

Expand Down

0 comments on commit 80b1ecd

Please sign in to comment.