mirror of
https://github.com/silverstripe/silverstripe-comments
synced 2024-10-22 11:05:49 +02:00
Merge pull request #350 from creative-commoners/pulls/3/depr-messages
API Update deprecations
This commit is contained in:
commit
9bfef9e931
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace SilverStripe\Comments\Admin;
|
namespace SilverStripe\Comments\Admin;
|
||||||
|
|
||||||
|
use SilverStripe\Dev\Deprecation;
|
||||||
use SilverStripe\Comments\Model\Comment;
|
use SilverStripe\Comments\Model\Comment;
|
||||||
use SilverStripe\Control\Controller;
|
use SilverStripe\Control\Controller;
|
||||||
use SilverStripe\Forms\GridField\GridField;
|
use SilverStripe\Forms\GridField\GridField;
|
||||||
@ -10,13 +11,22 @@ use SilverStripe\Forms\GridField\GridField_ColumnProvider;
|
|||||||
use SilverStripe\Forms\GridField\GridField_FormAction;
|
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
|
class CommentsGridFieldAction implements GridField_ColumnProvider, GridField_ActionProvider
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
Deprecation::notice(
|
||||||
|
'3.2.0',
|
||||||
|
'Use CommentsGridFieldApproveAction CommentsGridFieldSpamAction instead',
|
||||||
|
Deprecation::SCOPE_CLASS
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
public function augmentColumns($gridField, &$columns)
|
public function augmentColumns($gridField, &$columns)
|
||||||
{
|
{
|
||||||
if (!in_array('Actions', $columns ?? [])) {
|
if (!in_array('Actions', $columns ?? [])) {
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace SilverStripe\Comments\Admin\CommentsGridFieldBulkAction;
|
namespace SilverStripe\Comments\Admin\CommentsGridFieldBulkAction;
|
||||||
|
|
||||||
|
use SilverStripe\Dev\Deprecation;
|
||||||
use Colymba\BulkManager\BulkAction\Handler as GridFieldBulkActionHandler;
|
use Colymba\BulkManager\BulkAction\Handler as GridFieldBulkActionHandler;
|
||||||
use SilverStripe\Core\Convert;
|
use SilverStripe\Core\Convert;
|
||||||
use SilverStripe\Control\HTTPRequest;
|
use SilverStripe\Control\HTTPRequest;
|
||||||
@ -10,7 +11,7 @@ use SilverStripe\Control\HTTPResponse;
|
|||||||
/**
|
/**
|
||||||
* A {@link GridFieldBulkActionHandler} for bulk marking comments as spam
|
* 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
|
class Handler extends GridFieldBulkActionHandler
|
||||||
{
|
{
|
||||||
@ -28,6 +29,11 @@ class Handler extends GridFieldBulkActionHandler
|
|||||||
* @param HTTPRequest $request
|
* @param HTTPRequest $request
|
||||||
* @return HTTPResponse
|
* @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)
|
public function spam(HTTPRequest $request)
|
||||||
{
|
{
|
||||||
$ids = array();
|
$ids = array();
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace SilverStripe\Comments\Model;
|
namespace SilverStripe\Comments\Model;
|
||||||
|
|
||||||
|
use SilverStripe\Dev\Deprecation;
|
||||||
use HTMLPurifier;
|
use HTMLPurifier;
|
||||||
use HTMLPurifier_Config;
|
use HTMLPurifier_Config;
|
||||||
use SilverStripe\Comments\Controllers\CommentingController;
|
use SilverStripe\Comments\Controllers\CommentingController;
|
||||||
@ -264,6 +265,7 @@ class Comment extends DataObject
|
|||||||
*/
|
*/
|
||||||
public function getParent()
|
public function getParent()
|
||||||
{
|
{
|
||||||
|
Deprecation::notice('4.0.0', 'Use $this->Parent() instead');
|
||||||
return $this->BaseClass && $this->ParentID
|
return $this->BaseClass && $this->ParentID
|
||||||
? DataObject::get_by_id($this->BaseClass, $this->ParentID, true)
|
? DataObject::get_by_id($this->BaseClass, $this->ParentID, true)
|
||||||
: null;
|
: null;
|
||||||
|
Loading…
Reference in New Issue
Block a user