Skip to content
This repository has been archived by the owner on Jul 22, 2022. It is now read-only.

Commit

Permalink
Add deprecation to remove SimplePager (#420)
Browse files Browse the repository at this point in the history
  • Loading branch information
ElectricMaxxx authored and greg0ire committed Feb 6, 2017
1 parent bb9f93b commit 395ccfc
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Datagrid/SimplePager.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@

use Doctrine\Common\Collections\ArrayCollection;

/**
* NEXT_MAJOR: remove this class.
* @deprecated since 1.2.7, to be removed in 2.0. Use Sonata\AdminBundle\Datagrid\SimplePager instead.
*/
class SimplePager extends Pager
{
/**
Expand Down Expand Up @@ -46,6 +51,11 @@ class SimplePager extends Pager
*/
public function __construct($maxPerPage = 10, $threshold = 2)
{
@trigger_error(
'The '.__CLASS__.' class is deprecated since 1.2.7, to be removed in 2.0. '.
'Use Sonata\AdminBundle\Datagrid\SimplePager instead.',
E_USER_DEPRECATED
);
parent::__construct($maxPerPage);
$this->setThreshold($threshold);
}
Expand Down
3 changes: 3 additions & 0 deletions Tests/Datagrid/SimplePagerBasicTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
use Doctrine\Common\Collections\ArrayCollection;
use Sonata\DoctrinePHPCRAdminBundle\Datagrid\SimplePager;

/**
* @group legacy
*/
class SimplePagerBasicTest extends \PHPUnit_Framework_TestCase
{
public function setUp()
Expand Down
3 changes: 3 additions & 0 deletions Tests/Datagrid/SimplePagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
use Doctrine\Common\Collections\ArrayCollection;
use Sonata\DoctrinePHPCRAdminBundle\Datagrid\SimplePager;

/**
* @group legacy
*/
class SimplePagerTest extends \PHPUnit_Framework_TestCase
{
public function setUp()
Expand Down
4 changes: 4 additions & 0 deletions UPGRADE-1.x.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
UPGRADE 1.x
===========

### Deprecated `Sonata\DoctrinePHPCRAdminBundle\Datagrid\SimplePager`

When adding pager function you should use `Sonata\AdminBundle\Datagrid\SimplePager` now.

### Tests

All files under the ``Tests`` directory are now correctly handled as internal test classes.
Expand Down

0 comments on commit 395ccfc

Please sign in to comment.