mirror of
https://github.com/silverstripe/silverstripe-comments
synced 2024-10-22 11:05:49 +02:00
API Update deprecations
This commit is contained in:
parent
a88bd6fff6
commit
c3ef4d6efc
@ -2,6 +2,7 @@
|
||||
|
||||
namespace SilverStripe\Comments\Admin;
|
||||
|
||||
use SilverStripe\Dev\Deprecation;
|
||||
use SilverStripe\Comments\Model\Comment;
|
||||
use SilverStripe\Control\Controller;
|
||||
use SilverStripe\Forms\GridField\GridField;
|
||||
@ -10,13 +11,22 @@ use SilverStripe\Forms\GridField\GridField_ColumnProvider;
|
||||
use SilverStripe\Forms\GridField\GridField_FormAction;
|
||||
|
||||
/**
|
||||
* @deprecated 3.2.0 {@see CommentsGridFieldApproveAction} and {@see CommentsGridFieldSpamAction} instead
|
||||
* @deprecated 3.2.0 Use CommentsGridFieldApproveAction CommentsGridFieldSpamAction instead
|
||||
*/
|
||||
class CommentsGridFieldAction implements GridField_ColumnProvider, GridField_ActionProvider
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
Deprecation::notice(
|
||||
'3.2.0',
|
||||
'Use CommentsGridFieldApproveAction CommentsGridFieldSpamAction instead',
|
||||
Deprecation::SCOPE_CLASS
|
||||
);
|
||||
}
|
||||
|
||||
public function augmentColumns($gridField, &$columns)
|
||||
{
|
||||
if (!in_array('Actions', $columns ?? [])) {
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
namespace SilverStripe\Comments\Admin\CommentsGridFieldBulkAction;
|
||||
|
||||
use SilverStripe\Dev\Deprecation;
|
||||
use Colymba\BulkManager\BulkAction\Handler as GridFieldBulkActionHandler;
|
||||
use SilverStripe\Core\Convert;
|
||||
use SilverStripe\Control\HTTPRequest;
|
||||
@ -10,7 +11,7 @@ use SilverStripe\Control\HTTPResponse;
|
||||
/**
|
||||
* A {@link GridFieldBulkActionHandler} for bulk marking comments as spam
|
||||
*
|
||||
* @deprecated 3.1..4.0 Abstract handlers are removed, please use concrete Spam or Approve handlers
|
||||
* @deprecated 3.1.0 Use concrete Spam or Approve handlers instead
|
||||
*/
|
||||
class Handler extends GridFieldBulkActionHandler
|
||||
{
|
||||
@ -28,6 +29,11 @@ class Handler extends GridFieldBulkActionHandler
|
||||
* @param HTTPRequest $request
|
||||
* @return HTTPResponse
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
Deprecation::notice('3.1.0', 'Use concrete Spam or Approve handlers instead', Deprecation::SCOPE_CLASS);
|
||||
}
|
||||
|
||||
public function spam(HTTPRequest $request)
|
||||
{
|
||||
$ids = array();
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
namespace SilverStripe\Comments\Model;
|
||||
|
||||
use SilverStripe\Dev\Deprecation;
|
||||
use HTMLPurifier;
|
||||
use HTMLPurifier_Config;
|
||||
use SilverStripe\Comments\Controllers\CommentingController;
|
||||
@ -264,6 +265,7 @@ class Comment extends DataObject
|
||||
*/
|
||||
public function getParent()
|
||||
{
|
||||
Deprecation::notice('4.0.0', 'Use $this->Parent() instead');
|
||||
return $this->BaseClass && $this->ParentID
|
||||
? DataObject::get_by_id($this->BaseClass, $this->ParentID, true)
|
||||
: null;
|
||||
|
Loading…
Reference in New Issue
Block a user