Skip to content

Commit

Permalink
Added DatagridTest
Browse files Browse the repository at this point in the history
  • Loading branch information
pulzarraider committed Sep 13, 2013
1 parent 63f6412 commit bcfed54
Show file tree
Hide file tree
Showing 7 changed files with 427 additions and 14 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
CHANGELOG
=========

### 2013-09-13

* [BC BREAK] added ``getMaxPerPage``, ``setMaxPerPage``, ``setPage``,
``setQuery ``, ``getResults`` to the PagerInterface
If you do not extend the Pager class, you need to add these methods to
your pager.

* [BC BREAK] added ``isActive`` to the FilterInterface
If you do not extend the Filter class, you need to add this method to
your filter.

### 2013-09-11

* [BC BREAK] added ``hasShowFieldDescription``, ``hasListFieldDescription``,
Expand Down
18 changes: 5 additions & 13 deletions Datagrid/Pager.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ public function __construct($maxPerPage = 10)
}

/**
* Returns an array of results on the given page.
*
* @return array
* {@inheritdoc}
*/
abstract public function getResults();

Expand Down Expand Up @@ -316,9 +314,7 @@ public function getPreviousPage()
}

/**
* Sets the current page.
*
* @param integer $page
* {@inheritdoc}
*/
public function setPage($page)
{
Expand All @@ -331,19 +327,15 @@ public function setPage($page)
}

/**
* Returns the maximum number of results per page.
*
* @return integer
* {@inheritdoc}
*/
public function getMaxPerPage()
{
return $this->maxPerPage;
}

/**
* Sets the maximum number of results per page.
*
* @param integer $max
* {@inheritdoc}
*/
public function setMaxPerPage($max)
{
Expand Down Expand Up @@ -612,7 +604,7 @@ protected function retrieveObject($offset)
}

/**
* @param mixed $query
* {@inheritdoc}
*/
public function setQuery($query)
{
Expand Down
35 changes: 35 additions & 0 deletions Datagrid/PagerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,39 @@ interface PagerInterface
* @return void
*/
public function init();

/**
* Returns the maximum number of results per page.
*
* @return integer
*/
public function getMaxPerPage();

/**
* Sets the maximum number of results per page.
*
* @param integer $max
*/
public function setMaxPerPage($max);

/**
* Sets the current page.
*
* @param integer $page
*/
public function setPage($page);

/**
* Set query
*
* @param mixed $query
*/
public function setQuery($query);

/**
* Returns an array of results on the given page.
*
* @return array
*/
public function getResults();
}
2 changes: 1 addition & 1 deletion Filter/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public function getValue()
}

/**
* @return string
* {@inheritdoc}
*/
public function isActive()
{
Expand Down
7 changes: 7 additions & 0 deletions Filter/FilterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,11 @@ public function getFieldType();
* @return array
*/
public function getRenderSettings();

/**
* Returns true if filter is active
*
* @return boolean
*/
public function isActive();
}
Loading

0 comments on commit bcfed54

Please sign in to comment.