Merge pull request #779 from creative-commoners/pulls/4/deprecate-widgets

API Deprecate widget classes
This commit is contained in:
Guy Sartorelli 2024-08-21 09:35:27 +12:00 committed by GitHub
commit 92ea9d18b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 178 additions and 4 deletions

View File

@ -5,14 +5,28 @@ namespace SilverStripe\Blog\Model;
use SilverStripe\ORM\DataExtension;
use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\CheckboxField;
use SilverStripe\Dev\Deprecation;
/**
* Adds a checkbox field for featured blog posts widget.
*
* @extends DataExtension<BlogPost>
* @deprecated 4.3.0 Will be removed without equivalent functionality to replace it
*/
class BlogPostFeaturedExtension extends DataExtension
{
public function __construct()
{
Deprecation::withNoReplacement(function () {
Deprecation::notice(
'4.3.0',
'Will be removed without equivalent functionality to replace it',
Deprecation::SCOPE_CLASS
);
});
parent::__construct();
}
/**
* @var array
*/

View File

@ -16,6 +16,8 @@ use SilverStripe\ORM\Queries\SQLSelect;
use SilverStripe\Versioned\Versioned;
use SilverStripe\View\ArrayData;
use SilverStripe\Widgets\Model\Widget;
use SilverStripe\Dev\Deprecation;
use SilverStripe\ORM\DataObject;
if (!class_exists(Widget::class)) {
return;
@ -26,6 +28,7 @@ if (!class_exists(Widget::class)) {
*
* @property string $ArchiveType
* @property int $NumberToDisplay
* @deprecated 4.3.0 Will be removed without equivalent functionality to replace it
*/
class BlogArchiveWidget extends Widget
{
@ -71,6 +74,18 @@ class BlogArchiveWidget extends Widget
*/
private static $table_name = 'BlogArchiveWidget';
public function __construct($record = [], $creationType = DataObject::CREATE_OBJECT, $queryParams = [])
{
Deprecation::withNoReplacement(function () {
Deprecation::notice(
'4.3.0',
'Will be removed without equivalent functionality to replace it',
Deprecation::SCOPE_CLASS
);
});
parent::__construct($record, $creationType, $queryParams);
}
/**
* {@inheritdoc}
*/

View File

@ -3,12 +3,26 @@
namespace SilverStripe\Blog\Widgets;
use SilverStripe\Widgets\Model\WidgetController;
use SilverStripe\Dev\Deprecation;
if (!class_exists(WidgetController::class)) {
return;
}
/**
* @deprecated 4.3.0 Will be removed without equivalent functionality to replace it
*/
class BlogArchiveWidgetController extends WidgetController
{
public function __construct($widget = null)
{
Deprecation::withNoReplacement(function () {
Deprecation::notice(
'4.3.0',
'Will be removed without equivalent functionality to replace it',
Deprecation::SCOPE_CLASS
);
});
parent::__construct($widget);
}
}

View File

@ -10,6 +10,8 @@ use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\NumericField;
use SilverStripe\ORM\DataList;
use SilverStripe\Widgets\Model\Widget;
use SilverStripe\Dev\Deprecation;
use SilverStripe\ORM\DataObject;
if (!class_exists(Widget::class)) {
return;
@ -17,6 +19,7 @@ if (!class_exists(Widget::class)) {
/**
* @method Blog Blog()
* @deprecated 4.3.0 Will be removed without equivalent functionality to replace it
*/
class BlogCategoriesWidget extends Widget
{
@ -56,6 +59,18 @@ class BlogCategoriesWidget extends Widget
*/
private static $table_name = 'BlogCategoriesWidget';
public function __construct($record = [], $creationType = DataObject::CREATE_OBJECT, $queryParams = [])
{
Deprecation::withNoReplacement(function () {
Deprecation::notice(
'4.3.0',
'Will be removed without equivalent functionality to replace it',
Deprecation::SCOPE_CLASS
);
});
parent::__construct($record, $creationType, $queryParams);
}
/**
* {@inheritdoc}
*/

View File

@ -3,12 +3,26 @@
namespace SilverStripe\Blog\Widgets;
use SilverStripe\Widgets\Model\WidgetController;
use SilverStripe\Dev\Deprecation;
if (!class_exists(WidgetController::class)) {
return;
}
/**
* @deprecated 4.3.0 Will be removed without equivalent functionality to replace it
*/
class BlogCategoriesWidgetController extends WidgetController
{
public function __construct($widget = null)
{
Deprecation::withNoReplacement(function () {
Deprecation::notice(
'4.3.0',
'Will be removed without equivalent functionality to replace it',
Deprecation::SCOPE_CLASS
);
});
parent::__construct($widget);
}
}

View File

@ -9,6 +9,8 @@ use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\NumericField;
use SilverStripe\ORM\DataList;
use SilverStripe\Widgets\Model\Widget;
use SilverStripe\Dev\Deprecation;
use SilverStripe\ORM\DataObject;
if (!class_exists(Widget::class)) {
return;
@ -18,6 +20,7 @@ if (!class_exists(Widget::class)) {
* @method Blog Blog()
*
* @property int $NumberOfPosts
* @deprecated 4.3.0 Will be removed without equivalent functionality to replace it
*/
class BlogFeaturedPostsWidget extends Widget
{
@ -55,6 +58,18 @@ class BlogFeaturedPostsWidget extends Widget
*/
private static $table_name = 'BlogFeaturedPostsWidget';
public function __construct($record = [], $creationType = DataObject::CREATE_OBJECT, $queryParams = [])
{
Deprecation::withNoReplacement(function () {
Deprecation::notice(
'4.3.0',
'Will be removed without equivalent functionality to replace it',
Deprecation::SCOPE_CLASS
);
});
parent::__construct($record, $creationType, $queryParams);
}
/**
* {@inheritdoc}
*/

View File

@ -9,6 +9,8 @@ use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\NumericField;
use SilverStripe\ORM\DataList;
use SilverStripe\Widgets\Model\Widget;
use SilverStripe\ORM\DataObject;
use SilverStripe\Dev\Deprecation;
if (!class_exists(Widget::class)) {
return;
@ -18,6 +20,7 @@ if (!class_exists(Widget::class)) {
* @method Blog Blog()
*
* @property int $NumberOfPosts
* @deprecated 4.3.0 Will be removed without equivalent functionality to replace it
*/
class BlogRecentPostsWidget extends Widget
{
@ -55,6 +58,18 @@ class BlogRecentPostsWidget extends Widget
*/
private static $table_name = 'BlogRecentPostsWidget';
public function __construct($record = [], $creationType = DataObject::CREATE_OBJECT, $queryParams = [])
{
Deprecation::withNoReplacement(function () {
Deprecation::notice(
'4.3.0',
'Will be removed without equivalent functionality to replace it',
Deprecation::SCOPE_CLASS
);
});
parent::__construct($record, $creationType, $queryParams);
}
/**
* {@inheritdoc}
*/

View File

@ -3,12 +3,26 @@
namespace SilverStripe\Blog\Widgets;
use SilverStripe\Widgets\Model\WidgetController;
use SilverStripe\Dev\Deprecation;
if (!class_exists(WidgetController::class)) {
return;
}
/**
* @deprecated 4.3.0 Will be removed without equivalent functionality to replace it
*/
class BlogRecentPostsWidgetController extends WidgetController
{
public function __construct($widget = null)
{
Deprecation::withNoReplacement(function () {
Deprecation::notice(
'4.3.0',
'Will be removed without equivalent functionality to replace it',
Deprecation::SCOPE_CLASS
);
});
parent::__construct($widget);
}
}

View File

@ -10,6 +10,7 @@ use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\DB;
use SilverStripe\Widgets\Model\Widget;
use SilverStripe\Control\Controller;
use SilverStripe\Dev\Deprecation;
if (!class_exists(Widget::class)) {
return;
@ -17,6 +18,7 @@ if (!class_exists(Widget::class)) {
/**
* @method Blog Blog()
* @deprecated 4.3.0 Will be removed without equivalent functionality to replace it
*/
class BlogTagsCloudWidget extends Widget
{
@ -52,6 +54,18 @@ class BlogTagsCloudWidget extends Widget
*/
private static $table_name = 'BlogTagsCloudWidget';
public function __construct($record = [], $creationType = DataObject::CREATE_OBJECT, $queryParams = [])
{
Deprecation::withNoReplacement(function () {
Deprecation::notice(
'4.3.0',
'Will be removed without equivalent functionality to replace it',
Deprecation::SCOPE_CLASS
);
});
parent::__construct($record, $creationType, $queryParams);
}
/**
* {@inheritdoc}
*/

View File

@ -3,11 +3,26 @@
namespace SilverStripe\Blog\Widgets;
use SilverStripe\Widgets\Model\WidgetController;
use SilverStripe\Dev\Deprecation;
if (!class_exists(WidgetController::class)) {
return;
}
/**
* @deprecated 4.3.0 Will be removed without equivalent functionality to replace it
*/
class BlogTagsCloudWidgetController extends WidgetController
{
public function __construct($widget = null)
{
Deprecation::withNoReplacement(function () {
Deprecation::notice(
'4.3.0',
'Will be removed without equivalent functionality to replace it',
Deprecation::SCOPE_CLASS
);
});
parent::__construct($widget);
}
}

View File

@ -10,6 +10,8 @@ use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\NumericField;
use SilverStripe\ORM\DataList;
use SilverStripe\Widgets\Model\Widget;
use SilverStripe\Dev\Deprecation;
use SilverStripe\ORM\DataObject;
if (!class_exists(Widget::class)) {
return;
@ -17,6 +19,7 @@ if (!class_exists(Widget::class)) {
/**
* @method Blog Blog()
* @deprecated 4.3.0 Will be removed without equivalent functionality to replace it
*/
class BlogTagsWidget extends Widget
{
@ -56,6 +59,18 @@ class BlogTagsWidget extends Widget
*/
private static $table_name = 'BlogTagsWidget';
public function __construct($record = [], $creationType = DataObject::CREATE_OBJECT, $queryParams = [])
{
Deprecation::withNoReplacement(function () {
Deprecation::notice(
'4.3.0',
'Will be removed without equivalent functionality to replace it',
Deprecation::SCOPE_CLASS
);
});
parent::__construct($record, $creationType, $queryParams);
}
/**
* {@inheritdoc}
*/

View File

@ -3,12 +3,26 @@
namespace SilverStripe\Blog\Widgets;
use SilverStripe\Widgets\Model\WidgetController;
use SilverStripe\Dev\Deprecation;
if (!class_exists(WidgetController::class)) {
return;
}
/**
* @deprecated 4.3.0 Will be removed without equivalent functionality to replace it
*/
class BlogTagsWidgetController extends WidgetController
{
public function __construct($widget = null)
{
Deprecation::withNoReplacement(function () {
Deprecation::notice(
'4.3.0',
'Will be removed without equivalent functionality to replace it',
Deprecation::SCOPE_CLASS
);
});
parent::__construct($widget);
}
}