Skip to content

Commit

Permalink
API CHANGE: GridFieldConfig should extend object to make use of Objec…
Browse files Browse the repository at this point in the history
…t::create() this also fixes GridFieldConfig_RecordViewer::create() which was not working before

but don't extend Object
  • Loading branch information
Zauberfisch authored and Sam Minnee committed Aug 29, 2012
1 parent c738744 commit 70b22fa
Showing 1 changed file with 10 additions and 38 deletions.
48 changes: 10 additions & 38 deletions forms/gridfield/GridFieldConfig.php
Expand Up @@ -14,20 +14,22 @@
* - {@link GridFieldConfig_RelationEditor}
*/
class GridFieldConfig {

/**
*
* @return GridFieldConfig
* @var ArrayList
*/
public static function create(){
return new GridFieldConfig();
}
protected $components = null;

/**
*
* @var ArrayList
* @param mixed $arguments,... arguments to pass to the constructor
* @return GridFieldConfig
*/
protected $components = null;
public static function create() {
return call_user_func_array('Object::create', array_merge(
array(get_called_class()),
func_get_args()
));
}

/**
*
Expand Down Expand Up @@ -131,16 +133,6 @@ public function getComponentByType($type) {
* with sortable and searchable headers.
*/
class GridFieldConfig_Base extends GridFieldConfig {

/**
*
* @param int $itemsPerPage - How many items per page should show up per page
* @return GridFieldConfig_Base
*/
public static function create($itemsPerPage=null){
return new GridFieldConfig_Base($itemsPerPage);
}

/**
*
* @param int $itemsPerPage - How many items per page should show up
Expand Down Expand Up @@ -176,16 +168,6 @@ public function __construct($itemsPerPage = null) {
*
*/
class GridFieldConfig_RecordEditor extends GridFieldConfig {

/**
*
* @param int $itemsPerPage - How many items per page should show up
* @return GridFieldConfig_RecordEditor
*/
public static function create($itemsPerPage=null){
return new GridFieldConfig_RecordEditor($itemsPerPage);
}

/**
*
* @param int $itemsPerPage - How many items per page should show up
Expand Down Expand Up @@ -225,16 +207,6 @@ public function __construct($itemsPerPage=null) {
* </code>
*/
class GridFieldConfig_RelationEditor extends GridFieldConfig {

/**
*
* @param int $itemsPerPage - How many items per page should show up
* @return GridFieldConfig_RelationEditor
*/
public static function create($itemsPerPage=null){
return new GridFieldConfig_RelationEditor($itemsPerPage);
}

/**
*
* @param int $itemsPerPage - How many items per page should show up
Expand Down

0 comments on commit 70b22fa

Please sign in to comment.