Merge pull request #17 from Zauberfisch/master

Return $this on all setters
This commit is contained in:
Andrew Short 2013-04-26 21:01:59 -07:00
commit 8b9ea0e1d6
4 changed files with 18 additions and 0 deletions

6
code/GridFieldAddExistingSearchButton.php Normal file → Executable file
View File

@ -28,9 +28,11 @@ class GridFieldAddExistingSearchButton implements
/**
* @param string $title
* @return GridFieldAddExistingSearchButton $this
*/
public function setTitle($title) {
$this->title = $title;
return $this;
}
/**
@ -42,18 +44,22 @@ class GridFieldAddExistingSearchButton implements
/**
* @param string $fragment
* @return GridFieldAddExistingSearchButton $this
*/
public function setFragment($fragment) {
$this->fragment = $fragment;
return $this;
}
/**
* Sets a custom list to use to provide the searchable items.
*
* @param SS_List $list
* @return GridFieldAddExistingSearchButton $this
*/
public function setSearchList(SS_List $list) {
$this->searchList = $list;
return $this;
}
/**

4
code/GridFieldAddNewInlineButton.php Normal file → Executable file
View File

@ -29,9 +29,11 @@ class GridFieldAddNewInlineButton implements GridField_HTMLProvider, GridField_S
* Sets the fragment name this button is rendered into.
*
* @param string $fragment
* @return GridFieldAddNewInlineButton $this
*/
public function setFragment($fragment) {
$this->fragment = $fragment;
return $this;
}
/**
@ -47,9 +49,11 @@ class GridFieldAddNewInlineButton implements GridField_HTMLProvider, GridField_S
* Sets the button title text.
*
* @param string $title
* @return GridFieldAddNewInlineButton $this
*/
public function setTitle($title) {
$this->title = $title;
return $this;
}
public function getHTMLFragments($grid) {

6
code/GridFieldAddNewMultiClass.php Normal file → Executable file
View File

@ -34,9 +34,11 @@ class GridFieldAddNewMultiClass implements GridField_HTMLProvider, GridField_URL
* Sets the fragment name this button is rendered into.
*
* @param string $fragment
* @return GridFieldAddNewMultiClass $this
*/
public function setFragment($fragment) {
$this->fragment = $fragment;
return $this;
}
/**
@ -52,9 +54,11 @@ class GridFieldAddNewMultiClass implements GridField_HTMLProvider, GridField_URL
* Sets the button title text.
*
* @param string $title
* @return GridFieldAddNewMultiClass $this
*/
public function setTitle($title) {
$this->title = $title;
return $this;
}
/**
@ -93,9 +97,11 @@ class GridFieldAddNewMultiClass implements GridField_HTMLProvider, GridField_URL
* Sets the classes that can be created using this button.
*
* @param array $classes a set of class names, optionally mapped to titles
* @return GridFieldAddNewMultiClass $this
*/
public function setClasses(array $classes) {
$this->classes = $classes;
return $this;
}
/**

2
code/GridFieldOrderableRows.php Normal file → Executable file
View File

@ -38,9 +38,11 @@ class GridFieldOrderableRows extends RequestHandler implements
* Sets the field used to specify the sort.
*
* @param string $sortField
* @return GridFieldOrderableRows $this
*/
public function setSortField($field) {
$this->sortField = $field;
return $this;
}
/**