Skip to content

Commit

Permalink
Feature/1415/Remove notification from cleanup snapshoot
Browse files Browse the repository at this point in the history
  • Loading branch information
eerison committed Jul 8, 2022
1 parent d2784a6 commit da26e0b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Consumer/CleanupSnapshotConsumer.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,21 @@

namespace Sonata\PageBundle\Consumer;

use Sonata\NotificationBundle\Backend\BackendInterface;
use Sonata\NotificationBundle\Consumer\ConsumerEvent;
use Sonata\NotificationBundle\Consumer\ConsumerInterface;
use Sonata\PageBundle\Model\PageManagerInterface;
use Sonata\PageBundle\Model\SnapshotManagerInterface;
use Sonata\PageBundle\Service\Contract\CreateSnapshotByPageInterface;

/**
* Consumer class to cleanup snapshots by a given page.
*
* NEXT_MAJOR: Remove this class
*
* @final since sonata-project/page-bundle 3.26
*
* @deprecated since 3.27, and it will be removed in 4.0.
*/
class CleanupSnapshotConsumer implements ConsumerInterface
{
Expand All @@ -41,6 +47,15 @@ class CleanupSnapshotConsumer implements ConsumerInterface
*/
public function __construct(SnapshotManagerInterface $snapshotManager, PageManagerInterface $pageManager)
{
@trigger_error(
sprintf(
'This %s is deprecated since sonata-project/page-bundle 3.27.0'.
' and will be removed in 4.0',
self::class
),
\E_USER_DEPRECATED
);

$this->snapshotManager = $snapshotManager;
$this->pageManager = $pageManager;
}
Expand Down
13 changes: 13 additions & 0 deletions src/Consumer/CleanupSnapshotsConsumer.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
/**
* Consumer class to cleanup snapshots.
*
* NEXT_MAJOR: Remove this class
*
* @final since sonata-project/page-bundle 3.26
*
* @deprecated since 3.27, and it will be removed in 4.0.
*/
class CleanupSnapshotsConsumer implements ConsumerInterface
{
Expand All @@ -47,6 +51,15 @@ class CleanupSnapshotsConsumer implements ConsumerInterface
*/
public function __construct(BackendInterface $asyncBackend, BackendInterface $runtimeBackend, PageManagerInterface $pageManager)
{
@trigger_error(
sprintf(
'This %s is deprecated since sonata-project/page-bundle 3.27.0'.
' and will be removed in 4.0',
self::class
),
\E_USER_DEPRECATED
);

$this->asyncBackend = $asyncBackend;
$this->runtimeBackend = $runtimeBackend;
$this->pageManager = $pageManager;
Expand Down

0 comments on commit da26e0b

Please sign in to comment.